If you have looked at pretty much any Microsoft provided T/SQL code you have probably seen an N in front of a string value when setting a variable much like this.

SELECT *
FROM sys.databases
WHERE name = N'master'

What this N does is tell the SQL Server that the data which is being passed in is uni-code and not character data.  When using only the Latin character set this is not really needed.  However if using characters which are not part of the basic Latin character set then the N is needed so that SQL knows that the data being given it is uni-code data.

Denny

Leave a Reply

Your email address will not be published. Required fields are marked *