sql server 2008 insert statement question

Posted by user61752 on Programmers See other posts from Programmers or by user61752
Published on 2012-07-06T14:47:11Z Indexed on 2012/07/06 15:22 UTC
Read the original article Hit count: 223

Filed under:
|

I am learning sql server 2008 t-sql.

To insert a varchar type, I just need to insert a string 'abc', but for nvarchar type, I need to add N in front (N'abc').

I have a table employee, it has 2 fields, firstname and lastname, they are both nvarchar(20).

insert into employee values('abc', 'def'); I test it, it works, seems like N is not required.

Why we need to add N in front for nvarchar type, what's the pro or con if we are not using it?

© Programmers or respective owner

Related posts about sql

Related posts about sql-server