Solved

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

Posted on 2015-02-07
1
138 Views
Last Modified: 2015-02-07
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
Comment
Question by:Mike Eghtebas
1 Comment
 
LVL 22

Accepted Solution

by:
Steve Wales earned 500 total points
ID: 40596468
The N is used for Unicode strings.

See this Knowledge Base article on the subject:

http://support.microsoft.com/kb/239530
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question