Showing posts with label openrowset. Show all posts
Showing posts with label openrowset. Show all posts

Thursday, March 22, 2012

Regarding Openrowset

In the following line of code, does anyone know what the letter N represents
that appears right after the word Bulk
FROM OPENROWSET(BULK N'C:\Text1.txt', SINGLE_BLOB) AS Document"Alvin Clark" <alvin.clark@.accudata.com> wrote in message
news:e6kl7vYEIHA.4228@.TK2MSFTNGP02.phx.gbl...
> In the following line of code, does anyone know what the letter N
> represents that appears right after the word Bulk
> FROM OPENROWSET(BULK N'C:\Text1.txt', SINGLE_BLOB) AS Document
The letter "N" preceding a string constant indicates that the string is a
unicode string. For additional information, refer to BOL (index - unicode
constants)|||This one throws me a little too. However, it has to do with all the
different character sets that SQL Server supports (coalitions).
The string:
'normal string'
uses a character set English speakers would consider normal. However, we
ain't the only ones on the planet. So SQL Server also supports UNICODE (with
the variable types of nchar, nvarchar, & ntext).
The string:
N'København'
is a Unicode/nchar string (copied from 2000 BOL - NCHAR page)
Therefore, the N'string' syntax is a way of being safe with your literal
strings and making sure some change in the character set doesn't mess you up
somewhere.
Jay
(Man I hope I got this right. About to find out...)
"Alvin Clark" <alvin.clark@.accudata.com> wrote in message
news:e6kl7vYEIHA.4228@.TK2MSFTNGP02.phx.gbl...
> In the following line of code, does anyone know what the letter N
> represents that appears right after the word Bulk
> FROM OPENROWSET(BULK N'C:\Text1.txt', SINGLE_BLOB) AS Document
>