Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

How do I develop a program to compare data on schema? Currently, I'm using a Visual Studio Data Comparison which I see the comparison was very fast and include of matching each data.

How to code for SQLDataCompare as the tools using C# or VB.NET? I would like to run it as program and at timer tick, it will compare and update if it detect a differential record.

What I have tried:

Currently, I made a program to compare based from count on both server. If there is different, the I will SELECT TOP <n> * FROM <tables>

Not so proper. But to compare each data line by line, I don't know how long it would take since there is one table contains more than 1 millions data..
Posted
Updated 5-Sep-16 2:55am

There is a SQL compare tool from Redgate that you can try. Of course it is not free. You might check the trial version of it.

If you really want to do it pro grammatically, then I would recommend you to use JOINs. That might be little efficient for you.

Else I afraid you have to load 2 tables and then start comparing inside your C# code.
 
Share this answer
 
Comments
Luiey Ichigo 5-Sep-16 22:03pm    
I was not encourage to use 3rd party software to be run on clients. The programming is the best way, but to accomplished it,is the hard way since I can't find one tutorial for this. But I have seen this JOIN things in here:
http://weblogs.sqlteam.com/jeffs/archive/2004/11/10/2737.aspx

Just wondering how to put those query to JOIN on both local and cloud server into one connection to perform it. Do you know how VS2015 Data Comparison works? I mean, how it be done to until there is view of Identical Record, Differential Record, Only in Sources/Target..
Whatever you mean by "compare data on shcema", i'd say it isn't simple job. Check this: CodeProject Knowledge Base[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900