• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 172
  • Last Modified:

SELECT empid, firstname + N' ' + lastname AS fullname

Is Query 1 the same as Query 2?

What is the role of N in Query 2?  Does it have something to do with using non-English characters in the last name?
Query 1:
SELECT empid, firstname + ' ' + lastname AS fullname
FROM HR.Employees;

Query 2:
SELECT empid, firstname + N' ' + lastname AS fullname
FROM HR.Employees;

Open in new window

0
Mike Eghtebas
Asked:
Mike Eghtebas
1 Solution
 
Steve WalesSenior Database AdministratorCommented:
The N is used for Unicode strings.

See this Knowledge Base article on the subject:

http://support.microsoft.com/kb/239530
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now