I have a SQL query that returns 2 columns whice are IDs from 2 tables on a one to one relationship.
I need this to update two table in a MS SQL database using a stored procedure, looping through each row of the query. The query currently matches 1:1 even if there is a dupe and it is important that it only updates 1 matching entry in each table even if there are dupes.
Please see attached sample query and notes.