I am trying to update database fields from one SQL Server table to another.
Our production SQL Server is [spdbprod.test.com\\spprod]
, our QA server is
how to add a linked server using tsql , please check this link : how to find linked server
for an example purpose suppose i have named the linked server "DESTINATION_SERVER" , database name is "DESTINATION_DB" and table name is "DESTINATION_TBL". then from your source server your query could be like this below:
UPDATE t1
SET t1.updatecolumn = t2.updatecolumn
FROM [DESTINATION_SERVER].[DESTINATION_DB].[dbo].[DESTINATION_TBL] t1
INNER JOIN [SOURCE-SERVER].[SOURCE_DB].[dbo].
[SOURCE_TBL] t2 ON (t1.matcingcolumn = t2.matchingcolumn)