Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 compare two database tables

Author  Topic 

cutepraba
Yak Posting Veteran

53 Posts

Posted - 2012-12-29 : 11:59:47
hello,

I have two dbs one running in DBS1(maindb), and another in DBS3(historydb), all the tables and structures are same. I am missing some rows in particular table in historydb(telling by count) basically its for my bk application purpose. is there any solution to compare both tables and catch it, so that i can restored it from original db.

thanks in advance.

config:
sql2000
windows2003
both can be connected in LAN

____________
Praba

jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2012-12-30 : 10:34:28
Take a look at Redgate's SQL Data Compare utility...it has a fully-functional trial version that you can use. If that is not something you can use - then you will be left with using a linked server and building queries using EXCEPT.

SELECT * FROM dbs1.dbo.table EXCEPT SELECT * FROM remote.dbs3.dbo.table;
Go to Top of Page
   

- Advertisement -