Home > Archive > SQL server exams > September 2003 > character string length





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author character string length
sjgross

2003-09-17, 2:39 pm

While studying about delimited identifiers I found the following:

Double quotation marks can be used only to delimit identifiers. They cannot delimit character strings.

To maintain compatibility with existing applications, SQL Server does not fully enforce this rule. Character strings can be enclosed in double quotes if the string does not exceed the length of an identifier; this practice is not recommended.

My question is when it says "string does not exceed the length of an identifier" does it mean 128 characters (116 if a temporary table) or does it mean that the string can't be longer than the length of the identifier?
cppwiz

2003-09-18, 9:31 am

Susan,

Yes, identifiers can not be longer than 128 characters. For identifiers that don't follow the rules, such as having spaces in the indentifier, they must be delimited with either double quotation marks ("My Table") or brackets ([My Table]). The total size of the delimited indentifier can not be over 128 characters.

Are you possibly confusing the identifier 128 character limit with the char data type limit of 8000 characters ? For example:

UPDATE [My Table]
SET [My Table].[My Column] = 'This can be 8000 characters long'

The [My Table] and [My Column] can only be 128 characters but if [My Column] is defined as char(8000) then it can be assigned a string value of up to 8000 characters.

Hope this helps...
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net