How to update rows based on one single row.
I want to update them:
SELECT field_one, field_two, field_three FROM some_table WHERE user_ID = 296
With values ββin this SELECT:
SELECT TOP 1 * field_one, field_two, field_three FROM some_table WHERE user_ID = 500 ORDER BY ID
Currently I am only updating field_one using:
DECLARE @field_one nvarchar(1000) SELECT @field_one = field_one FROM some_table WHERE user_ID = @copy_user_ID UPDATE some_table set field_one = @field_one where user_ID = @user_ID
Is there a way to do this with each field without the need for DECLARE of all variables?
going source share