Need some SQL syntax help :-)
Both databases are on the same server
db1 = DHE
db2 = DHE_Import
UPDATE DHE.dbo.tblAccounts
INNER JOIN DHE_Import.dbo
It is explained here http://erabhinavrana.blogspot.in/2014/01/how-to-execute-update-query-by-applying.html
It also has other useful code snippets which are commonly used.
update . A INNER JOIN . RA ON A.=RA. SET A.=RA.
Replace data in <> with your appropriate values.
That's It.
source:
http://www.dynamic-coders.com/how-to-update-two-different-tables-in-different-databases-on-same-server
- 热议问题