开发者

Explicitly casting all string parameters to Unicode

开发者 https://www.devze.com 2023-04-07 09:13 出处:网络
Is there a performance hit to prefixing all SP parameters with N\' even when the parameter is not a unicode string?

Is there a performance hit to prefixing all SP parameters with N' even when the parameter is not a unicode string?

I'm generating calls to a database dynamically in my .net code. Without actually checking each time I generate the code, I don't know which parameters are Unicode.

If the 开发者_StackOverflow社区answer is yes (there is a performance hit), what's the simplest way to check whether a paramter is unicode?


No, there isn't. If your column is Unicode you should always pass in a Unicode string.

However you shouldn't need to prefix strings from your .NET application with N. Are you not using parameterized statements?

0

精彩评论

暂无评论...
验证码 换一张
取 消