Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare to huge tables

Status
Not open for further replies.

andreis

Programmer
Apr 19, 2001
169
US
Hi, got a puzzling question during an interview - how to find 2 rows that are different in 2 otherwise identical tables with 2 millions records each, no indexes, no primary keys. Since the tables are huge, SELECT * FROM t1 EXCEPT SELECT * FROM t2 won't work because it'll take too long to run. Any ideas? Thanks.
 
I'd probably use the binary_checksum function. Of course, tables with millions of rows and no keys or indexes is just begging for trouble.

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
thanks, George, this is a great hint, although, for whatever reason, I still have a feeling this is not the most elegant solution I was expected to present...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top