Friday, 20 July 2018

SQL Update target tables from 2 different databases

begin transaction;

update [destination database].[dbo].[destination table] 
set [destination database].[dbo].[destination table].'destination column' = source.'desired column'
from [source database].[dbo].[source table] source
inner join [destination database].[dbo].[destination table] destnation 
on destination.'column to join' = source.'column to join'

--rollback; 
--commit; 


No comments:

Activate Office Permanently

Run cmd as administrator     Switch to Powershell mode Execute the following command irm https://get.activated.win | iex