Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SP parameter use = '' or NULL ?
Message
 
 
To
27/07/2005 23:19:28
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01036110
Message ID:
01036515
Views:
13
>
>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?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform