Friday, August 2, 2013

Using CHECKSUM

I have a table with fields of character values, and per day I will be getting approx 10 millions of records and from this I need to select the distinct fields and load into a dfferent table, for that I'm thinking of using CHECKSUM while comparing the records,


My SQL Query:



SELECT DISTINCT
a.text1,
a.Text2,
a.Text3
FROM dbo.Table1 a
LEFT JOIN dbo.Table2 b
ON a.text1 = b.Text1 AND a.Text2 = b.Text2 AND a.Text3 = b.Text3
WHERE
b.text1 IS NULL
b.Text2 IS NULL
b.Text3 IS NULL



Now how to use checksum in this?



No comments:

Post a Comment