Most strings in Windows are unicode UCS-16. Now I didn't write SSMS, but I know SSMS talks to SQL Server using the TDS protocol. So the logical thing to expect is that SSMS converts ''
strings to an 8-bit TDS string, while it can send N''
strings as a UCS-16 TDS string without conversion. Let's see what happens in a test:
select '₠', N'₠'
---- ----
? ₠
(1 row(s) affected)
The ?
is what's left of the Unicode-only character, it got lost in the UCS-16 to 8-bit translation.
Since SSMS does not know what type of string a stored procedure expects, I expect it to convert a ''
string in a stored procedure call as well.
The performance penalty should be negligible, UCS-16 to UCS-8 and back is very fast.