TableDiff.exe is a table comparison tool that comes with the sql server. CODE "C:\Program Files\Microsoft SQL Server\90\COM\tablediff.exe" -sourceserver MyServer1 -sourcedatabase MyDatabase1 -sourcetable MyTable1 -destinationserver MyServer1 -destinationdatabase MyDatabase1 -destinationtable MyTable2 -et DiffsTable This compares 2 tables in the same database on the same server and creates a new table called DiffsTable that holds the differences and creates a T-SQL script file at d:\MyTable1_MyTable2_diff.sql that holds the UPDATE/INSERT/DELETE statements to synchronize the 2 tables: CODE "C:\Program Files\Microsoft SQL Server\90\COM\tablediff.exe" -sourceserver MyServer1 -sourcedatabase MyDatabase1 -sourcetable MyTable1 -destinationserver MyServer1 -destinationdatabase MyDatabase1 -destinationtable MyTable2 -et DiffsTable -f d:\MyTable1_MyTable2_diff.sql You can also get simple GUI for this tool: |
Wednesday, August 15, 2007
SQL2005 Table comparison tool
Posted by Prakash at 9:51 AM
Labels: SQL, Sqlserver 2005
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment