Reputation: 34707
Just like in the question, not sure what the difference between ''
and N''
in SQL.
Upvotes: 3
Views: 203
Reputation: 263853
N
stores UNICODE
data just like NVARCHAR
and VARCHAR
An nvarchar
column can store any Unicode data. A varchar
column is restricted to an 8-bit codepage. Some people think that varchar
should be used because it takes up less space. I believe this is not the correct answer. Codepage incompatabilities are a pain, and Unicode is the cure for codepage problems. With cheap disk and memory nowadays, there is really no reason to waste time mucking around with code pages anymore.
Upvotes: 2
Reputation: 50855
It's shorthand for Nvarchar
. Using that notation tells the parser to treat the following string data as nvarchar
instead of the default varchar
.
Example:
SELECT N'This is a test'; -- NVarChar data
SELECT 'Test is a test'; -- VarChar data
Upvotes: 8