Sunday, March 11, 2012

Check data Availbility between two table in Sqlserver 2005 using C#

I have Two table.One is MainTable and other is Temporary table.Both have Same Field

Before entering data into main table I want to check weather these data's are already there or not.

Here i am checking only three column of temporary table to the MainTable.

INSERT INTO MailTable(A, B, C)
SELECT (A, B, C) FROM TemporaryTable WHERE TemporaryTable.A NOT IN (SELECT A FROM MailTable)

|||

Thank you Thank you Thank you Thank you Very Much

No comments:

Post a Comment