Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stupid question time.... 1

Status
Not open for further replies.

gbaughma

IS-IT--Management
Staff member
Joined
Nov 21, 2003
Messages
4,773
Location
US
I've seen this on a couple of code snippets....

Code:
EXEC    @return_value = [dbo].[GetHistorianDataByField]
                @InputColumnName = N'[PI353005]',
                @StartDate = N'2008-01-01 00:00:00',
                @EndDate = N'2009-01-01 00:00:00'

Now for my stupid question:
What is the "N" before the string delimiters??


Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
The N means you have a string with unicode data.

In the code snippet you show, you don't need the N for the dates because you cannot possibly have non-ascii characters.

For example, there are unicode characters that appear like regular text drawn upside down. Without the N, the characters are converted to ascii. For example:

Code:
Select [!]N[/!]'?x?? u?op ?p?sdn', '?x?? u?op ?p?sdn'



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
btw... not a dumb question. Took me 6 months to figure that out.

lol

Simi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top