tablediff tool takes very long time to execute [closed]
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
精彩评论