Solved

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

Posted on 2015-02-07
1
119 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how the fundamental information of how to create a table.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now