Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Something wrong with IF statement - Please help?

Author  Topic 

ppuar
Starting Member

28 Posts

Posted - 2001-10-18 : 14:00:08
if (@chInsUpd = 'I') AND exists(select * from table1 where a = @b) AND exists(select * from table2 where User1 = 102127)
update table1 set b = 0 where a = @c

if the last statement is false, it still goes into the if statement? I thought all the statments have to be true in order to enter the if statment? What is wrong?

   

- Advertisement -