Reputation: 10154
Just like the subject stated:
what does the letter N
do in SQL like this:
SELECT P.ProductID,
S.SupplierID,
S.CompanyName
FROM Suppliers AS S JOIN Products AS P
ON (S.SupplierID = P.SupplierID)
WHERE P.UnitPrice > $10
AND S.CompanyName LIKE N'F%' -- what is the N for?
Upvotes: 20
Views: 27752
Reputation: 55509
'N'
stands for representing unicode characters.
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.
Original source - http://itknowledgeexchange.techtarget.com/sql-server/whats-up-with-the-n-in-front-of-string-values/
Upvotes: 26