Why do we need to put N before strings in Microsoft SQL Server?
- by user61752
I'm learning T-SQL. From the examples I've seen, to insert text in a varchar() cell, I can write just the string to insert, but for nvarchar() cells, every example prefix the strings with the letter N.
I tried the following query on a table which has nvarchar() rows, and it works fine, so the prefix N is not required:
insert into [TableName] values ('Hello', 'World')
Why the strings are prefixed with N in every example I've seen?
What are the pros or cons of using this prefix?