I have seen prefix N in some insert T-SQL queries. Many people have used N
before inserting the value in a table.
I searched, but I was not able to understand what is the purpose of including the N
before inserting any strings into the table.
INSERT INTO Personnel.Employees
VALUES(N'29730', N'Philippe', N'Horsford', 20.05, 1),
What purpose does this 'N' prefix serve, and when should it be used?
Best Answer
It's declaring the string as
nvarchar
data type, rather thanvarchar
To quote from Microsoft:
If you want to know the difference between these two data types, see this SO post:
What is the difference between varchar and nvarchar?