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
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Replication data checks

Author  Topic 

sqlpal2007
Posting Yak Master

200 Posts

Posted - 2011-07-07 : 16:27:53
Hello All,

At my work, transactional replication is used heavily and lot of critical reports are depending on the data residing at subscribers.

We have three tier replication strategy though.

server1 replicates to -> server2 replicates to ->server3.

The automated reports are run on both server2 and server3.

I wrote a huge code to get the table counts from these servers to check for record counts. But now we are it a point where need to know if record count is correct but what if data is off. For example quantity / Amounts / status code etc. critical fiends.

How would I know what is different in publisher and subscriber data wise?

Is there any tool which would do data/column compare or should I write a lengthy program to achieve this result.

Please any suggestions / advice would be greatly appreciated.

Thanks much,
-P

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-07-07 : 17:07:22
You can do it with a query with linked servers.

SELECT t1.*
FROM Table1 t1
JOIN Server2.Table1 t2
On t1.PrimaryKey = t2.PrimaryKey
WHERE t1.col1 <> t2.col1
Or t1.col2 <> t2.col2
...etc


Why are you having server 2 replicate to server 3, instead of making 'em both subscribers of server 1?
Go to Top of Page

vaari
Starting Member

15 Posts

Posted - 2011-07-08 : 02:13:02
You could also use the tablediff utility for this purpose.
Go to Top of Page

sqlpal2007
Posting Yak Master

200 Posts

Posted - 2011-07-08 : 09:13:33
Thanks guys.

This is how the replication topology was setup before. And I can't change it. The code will be lengthy and will have to be changed whenever new columns get added.

How do I use tablediff utility? I have never used it before.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-07-08 : 09:19:11
Lots of tablediff info here:

http://msdn.microsoft.com/en-us/library/ms162843.aspx
http://weblogs.sqlteam.com/mladenp/archive/2007/03/03/60125.aspx
http://weblogs.sqlteam.com/mladenp/archive/2007/08/10/60279.aspx

There are also built-in procedures to validate the subscription:

http://msdn.microsoft.com/en-us/library/ms152758.aspx
http://msdn.microsoft.com/en-us/library/ms147366.aspx
Go to Top of Page
   

- Advertisement -