开发者

tablediff tool takes very long time to execute [closed]

开发者 https://www.devze.com 2023-04-10 07:13 出处:网络
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time,or an extraordinarily narrow situation that is not generally applic
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. 开发者_如何学Go Closed 11 years ago.

I'm using tablediff.exe tool to compare two tables for differences and generate a change script on a remote SQL Server but it takes a very very long time to execute(after more than 1.5hour I gave up). tablediff.exe is running on my local machine, but the database is on another server(these are the requirements - I can't do anything about it)

I've profiled the SQL Server and it seems to execute the queries strangely slower then I expected.

The tables have about 2 million records, but when I executed this on my local machine it look a lot less(about 2-3 minutes).

I'm trying to find out what the reasons for this might be and if there's any way to speed this up?


tablediff.exe get all data from remote server and compare locally. The long time is time of upload/download of 2 millions rows.

Make specific query and execute in remote server. Examples: equals rows

SELECT * FROM bd1.schema1.table1
INTERSECT 
SELECT * FROM bd2.schema2.table2

rows in bd1.schema1.table1 and not in bd2.schema2.table2

SELECT * FROM bd1.schema1.table1
EXCEPT
SELECT * FROM bd2.schema2.table2
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号