Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SP parameter use = '' or NULL ?
Message
De
28/07/2005 21:25:09
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01036110
Message ID:
01036836
Vues:
14
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform