Home Forums SQL Server 2005 Development How to compare two tables on different databases RE: How to compare two tables on different databases
arup chakraborty
Hall of Fame
Points: 3640
More actions
June 11, 2009 at 5:37 am
#1007924
Since databases are different, use fully qualified name of the databases i.e. prefix the table name with server IP.database.user.table
To comapre the results, u can use EXCEPT operator.
loke
select * from d1..table1
except
select * from d2..table2