Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SP parameter use = '' or NULL ?
Message
From
28/07/2005 21:25:09
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01036110
Message ID:
01036836
Views:
13
Hi,

My compatiblity level is 80, using SP4


>>
>>01) I advise developer to use NULL insteads of '' and use default as NULL
>>for the parameter, is that right ?
>
>Yes, make default Null and advise developer not to pass parameter at all or pass as Null, if he has to.
>
>>
>>02) On the other hand, why is the SP code, if (LEN(@para1) > 0) become true
>>when @para1 = '' ?. Why ? Currently, i am using if(len(@para1) > 2) to check
>>for any parameter pass in and if(len(@para1) = 2) to check for empty parameter as changes to my system now is too big a impact.
>
>Maybe it has some binary character in it that looks like space but isn't? What's database compatibility level?
Best Regards
Virusim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform