inserting values by checking the existing values
-
Dear all, i am a novice programmer to sqlserver i just want a condition for how to insert the values into 3 tables of data at a time by considering that the three tables contains values if one of the table does not contain any values then it wont to be inserted into any of the tables
sai krishna
-
Dear all, i am a novice programmer to sqlserver i just want a condition for how to insert the values into 3 tables of data at a time by considering that the three tables contains values if one of the table does not contain any values then it wont to be inserted into any of the tables
sai krishna
Not sure if this is what you want... IF EXISTS (SELECT TOP 1 1 FROM tblTable1 WHERE col1 = 'abc') AND EXISTS (SELECT TOp 1 1 FROM tblTable2 WHERE col2= 'def') AND EXISTS ( SELECT TOP 1 1 FROM tblTable3 WHERE col3= 'xyz' ) --Do Something ELSE --Do Nothing Eliz.K www.oin1.com