Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 What's the N for in selects?

Author  Topic 

TimChenAllen
Starting Member

45 Posts

Posted - 2003-11-21 : 10:58:08
I've seen a lot of SQL statements that use a syntax like N'Some String', like this:
select * from dbo.sysobjects where id = object_id(N'[dbo].[udf]') 
and OBJECTPROPERTY(id, N'IsUserTable') = 1
What's that N there for?

I looked for this in Google and BOL, but the search didn't work out (can't just search for "N")

Thanks in advance.

--
Timothy Chen Allen
[url]http://www.timallen.org[/url]

raymondpeacock
Constraint Violating Yak Guru

367 Posts

Posted - 2003-11-21 : 11:07:51
Hi Tim

It's used to indicate Unicode constant strings for nchar, nvarchar and ntext data types. Check out 'Using Unicode Strings' in BOL.


Raymond
Go to Top of Page

TimChenAllen
Starting Member

45 Posts

Posted - 2003-11-21 : 11:48:11
quote:
Originally posted by raymondpeacock

It's used to indicate Unicode constant strings for nchar, nvarchar and ntext data types. Check out 'Using Unicode Strings' in BOL.


Thanks Raymond! Your message led me to this url: [url]http://msdn.microsoft.com/library/en-us/tsqlref/ts_ca-co_1n1v.asp?frame=true[/url] about Unicode (and other) constants. Thanks again.

--
Timothy Chen Allen
[url]http://www.timallen.org[/url]
Go to Top of Page
   

- Advertisement -