What does N' stands for in a SQL script ? (the one used before characters in insert script)

后端 未结 7 2395
孤城傲影
孤城傲影 2020-11-29 09:05

I generated an sql script like this,

INSERT [dbo].[TableName] ([Sno], [Name], [EmployeeId], [ProjectId], [Experience]) 
VALUES (1, N\'Dave\', N\'ESD157\', N\         


        
7条回答
  •  既然无缘
    2020-11-29 09:53

    The "N" prefix stands for National Language in the SQL-92 standard, and is used for representing unicode characters.

    Any time you pass Unicode data to SQL Server you must prefix the Unicode string with N.

    It is used when the type is from NVARCHAR, NCHAR or NTEXT.

    For more info refer to this: Why do some SQL strings have an 'N' prefix?

提交回复
热议问题