471,083 Members | 1,216 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,083 software developers and data experts.

What is purpose of N in SQL examples?

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.

Jul 23 '05 #1
1 1690
Eric Bragas wrote:
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)
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

52 posts views Thread by Tony Marston | last post: by
220 posts views Thread by Brandon J. Van Every | last post: by
53 posts views Thread by Deniz Bahar | last post: by
669 posts views Thread by Xah Lee | last post: by
89 posts views Thread by Tubular Technician | last post: by
184 posts views Thread by jim | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.