views:

32

answers:

3
USE AdventureWorks;
GO
IF OBJECT_ID (N'dbo.AWBuildVersion', N'U') IS NOT NULL
DROP TABLE dbo.AWBuildVersion;
GO

Whats the N symbolize in N'dbo.AWBuildVersion' & N'U' ?

+2  A: 

It's for Unicode. It's like an nvarchar or nchar SQL data type. For more information, see this: http://support.microsoft.com/kb/239530

Randy Minder
+1  A: 

This StackOverflow article has info on the subject. Basically the 'N' prefix denotes a Unicode string.

Peter Loron
+1  A: 

When dealing with Unicode string constants in SQL Server you must precede all Unicode strings with a capital letter N.

The "N" prefix stands for National Language in the SQL-92 standard, and must be uppercase.

If you do not prefix a Unicode string constant with N, SQL Server will convert it to the non-Unicode code page of the current db before it uses the string.

Sometimes people use N' out of habit, not when it is really necessary.

DOK