Update two tables from different database

Yesterday i had some tables to move from database1 to database2. I just moved the tables using SQL Export command. After that i had modify some columns in the table in the database1 and now i want to get the old value for a particular column in the table.

So was thinking what to do, then i found i have a primary key column in the table, I used a single update query and updated the data using database name with “..”.

Here is the query


update database1..table1 set column1= (select column1 from database2..table1 where primarykeycolumn=
database1..table1.primarykeycolumn) from database1..table1

This query worked in sql server, Not sure on the other database’s

Elam