Where do I find the table.diff.exe tool and what is it?

Filed under: Installation, SQL Server 2005 — Bryan Oliver at 5:15 pm on Friday, October 5, 2007

Q:  I just finished installing SQL server 2005. I can not find the “tablediff.exe” tool anyware on the system. Do I need to download it from MS site or is it on one of the installer CD? What does it do? Please let me know, thanks.

Bryan Oliver says:  TableDiff.exe is a table comparison tool that comes with the sql server.

It’s installed on the server in the:

“C:\Program Files\Microsoft SQL Server\90\COM\TableDiff.exe”if your SQL Server is installed in the program files on c: drive.

Example use:

This compares 2 tables in the same database on the same server and creates a new table called DiffsTable that holds the differences:

“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:

“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

http://msdn2.microsoft.com/en-us/library/ms162843.aspx

Technorati Tags:
, ,

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>