以编程方式比较SQL数据 [英] Compare SQL data programmatically

查看:65
本文介绍了以编程方式比较SQL数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





如何开发程序来比较架构数据?目前,我正在使用Visual Studio数据比较,我看到比较非常快,包括匹配每个数据。



如何编写SQLDataCompare作为工具使用C#还是VB.NET?我想将它作为程序运行,并且在计时器滴答时,如果它检测到差异记录,它将进行比较和更新。



我尝试过:



目前,我制作了一个程序,根据两台服务器上的计数进行比较。如果有不同,我将SELECT TOP< n> * FROM< tables>



不太合适。但是为了逐行比较每个数据,我不知道需要多长时间,因为有一个表包含超过1百万个数据..

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..

推荐答案

那里是Redgate的SQL比较工具,您可以尝试。当然不是免费的。您可以查看它的试用版。



如果您真的想以编程方式进行,那么我建议您使用JOIN。这可能对你来说效率不高。



否则我担心你必须加载2个表然后开始比较你的C#代码。
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.


无论你的意思是什么比较shcema的数据,我说这不是简单的工作。请检查: CodeProject知识库 [ ^ ]
Whatever you mean by "compare data on shcema", i'd say it isn't simple job. Check this: CodeProject Knowledge Base[^]


这篇关于以编程方式比较SQL数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆