N'[dbo].[App]' use of N | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

N'[dbo].[App]’ use of N

Hi , Can anyone tell methe use of N in this following querry??
SELECT * FROM dbo.sysindexes WHERE id = OBJECT_ID(N'[dbo].[App]’) AND name =
N’idx_APPStatusID’
Please note (N'[dbo].[App]’) here [dbo].[App]is the table so what is meant by giving the table name after N within quotes?
I’m really confused as I don’t know this syntax. Thanks
It forces the use of unicode. ***********************
Dinakar Nethi
SQL Server MVP
***********************
http://weblogs.sqlteam.com/dinakar/
Thanks Dinakar
From BOL: Unicode is a standard for mapping code points to characters. Because it is designed to cover all the characters of all the languages of the world, there is no need for different code pages to handle different sets of characters. SQL Server 2005 supports the Unicode Standard, Version 3.2.
Using the N Prefix
Unicode string constants that appear in code executed on the server, such as in stored procedures and triggers, must be preceded by the capital letter N. This is true even if the column being referenced is already defined as Unicode. Without the N prefix, the string is converted to the default code page of the database. This may not recognize certain characters. For example, the stored procedure created in the previous example can be executed on the server in the following way: EXECUTE Product_Info @name = N’Chain’
MohammedU.
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.

As a sidenote: Just because this is the default way how objects are scripted, it doesn’t necessarily mean that it is mandatory. Unless you deal with rather "exotic" charsets you can ignore and/or remove that N’. —
Frank Kalis
Moderator
Microsoft SQL Server MVP
Webmaster:http://www.insidesql.de
The argument of OBJECT_ID function is of type sysname, which is NVARCHAR(12<img src=’/community/emoticons/emotion-11.gif’ alt=’8)’ /><br /><br />Roji. P. Thomas<br />SQL Server MVP<br /<a target="_blank" href=http://toponewithties.blogspot.com>http://toponewithties.blogspot.com</a><br />
]]>