Friday, November 2, 2012

MS SQL tablediff utility

SQL Server has a utility used by replication to compare data in two tables for non-convergence.  This utility can be called from the command prompt or in a batch file.  Look here for details: http://msdn.microsoft.com/en-us/library/ms162843.aspx

I used this utility to find differences between tables located on two different servers.  This gave me very fast output. 

An example bat file is as follows:

   cd "c:\program files\microsoft sql server\90\com"
   tablediff -sourceserver "[SourceServer]" -sourcedatabase     

   "[SourceDatabase]" -sourcetable "[SourceTable]" -destinationserver 
   "[DestinationServer]" -destinationdatabase "[DestinationDatabase]" -  
   destinationtable "[DestinationTable]"
   pause


No comments:

Post a Comment