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)
 Stored proc if condition checking NULL

Author  Topic 

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2008-07-02 : 15:34:37
Can you please help, even though i pass a value to @AllModuleAccess , the if condition is not working. it is not associating the @AllModuleAccess value to the rest of the 3 parameters.

*********************
IF @AllModulesAccess <> NULL or @AllModulesAccess <> ''
BEGIN -- this user has been give access to all ccsnet modules
SET @KOAccess = @AllModulesAccess
SET @POAccess = @AllModulesAccess
SET @TFICAccess = @AllModulesAccess
END
*********************

Thank you very much for the information.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-07-02 : 15:35:48
Replace

<> NULL

with

IS NOT NULL

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2008-07-02 : 15:59:36
Thanks, Can i also use this:

IF len(isnull(@AllModulesAccess,'')) <> 0
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-07-02 : 16:38:22
You can use

IF @AllModulesAccess>''

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -