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 2005 Forums
 Transact-SQL (2005)
 If Conditions in SP

Author  Topic 

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2008-09-28 : 23:52:29
I have the followig If conditions being used in my stored procs.

Is this the right way to write an If conditions: all the parameters are integers:

IF @UserRole <> 1 AND @UserRole <> 4

------------------------------

IF @UserAccess = 1

------------------------------

Thanks.

PeterNeo
Constraint Violating Yak Guru

357 Posts

Posted - 2008-09-28 : 23:59:26
u can try this

IF @UserRole NOT IN (1, 4)
BEGIN
--------------
END
ELSE IF @UserAccess = 1
BEGIN
--------------
END
Go to Top of Page
   

- Advertisement -