Table1 Column1 Value1 Table2 Column2 Value2
-------------------------------------------------------------------
tbl_start DESC blue tbl_end Description red
tbl_job JOB Doctor tbl_role JOB Surgeon
I am trying to create an SQL stored procedure which will update tables based on the mapping table (I have created the one above as an example)
I have tried a few variations but can't seem to get my head around how the query will be written
For example:
UPDATE @TABLE2 SET @Column2 = @Value2 Where @Value2 = @Value1
So say tbl_end had the value 'blue' in the Description column, after the stored procedure runs it should have updated all instances of 'blue' to 'red'
In the same way if tbl_role had the value 'Doctor' in the JOB column, after the store procedure runs it should have changed 'Doctor' to 'Surgeon'
Thank you for any help, suggestions or comments
I appreciate any feedback
(Not worrying about security risks in this instance)