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
 General SQL Server Forums
 New to SQL Server Programming
 Proc return error eventhough passing correct value

Author  Topic 

vijays3
Constraint Violating Yak Guru

354 Posts

Posted - 2013-10-17 : 05:12:18
Removing this post

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-17 : 05:26:34
because you're checking @IsVisible = '' which corresponds to int value of 0

see this example


DECLARE @i int = 0

SELECT CASE WHEN @i='' THEN '0 is equivalent to blank value' ELSE '0 and blank are not equivalent' END


output
---------------------------------------
0 is equivalent to blank value



Also see

SELECT CAST('' AS int)

output
---------------
0



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

vijays3
Constraint Violating Yak Guru

354 Posts

Posted - 2013-10-17 : 06:39:04
Thank you very much visakh

Vijay is here to learn something from you guys.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-17 : 07:40:25
you're welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -