dbTalk Databases Forums  

What is purpose of N in SQL examples?

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss What is purpose of N in SQL examples? in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Eric Bragas
 
Posts: n/a

Default What is purpose of N in SQL examples? - 05-05-2005 , 12:48 PM






What is the purpose of the "N" preceding the parameter values in the
SQL examples?

Here is an example copied from Books Online, SP_ATTACH_DB:

EXEC sp_attach_db @dbname = N'pubs',
@filename1 = N'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\pubs.mdf',
@filename2 = N'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\pubs_log.ldf'

I've found that my sp_attach_db routine works without the "N", but I
need to know what it is that I don't know.

Thank you everybody for all your help.


Reply With Quote
  #2  
Old   
MGFoster
 
Posts: n/a

Default Re: What is purpose of N in SQL examples? - 05-05-2005 , 03:48 PM






Eric Bragas wrote:
Quote:
What is the purpose of the "N" preceding the parameter values in the
SQL examples?

Here is an example copied from Books Online, SP_ATTACH_DB:

EXEC sp_attach_db @dbname = N'pubs',
@filename1 = N'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\pubs.mdf',
@filename2 = N'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\pubs_log.ldf'

I've found that my sp_attach_db routine works without the "N", but I
need to know what it is that I don't know.
N before a string indicates that the string is a Unicode string (2 bytes
per character).
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.