Identifiers are names of objects in the database, such as user IDs, tables, and columns.
Identifiers have a maximum length of 128 bytes. They must be enclosed in double quotes or square brackets if any of the following conditions are true:
The identifier contains spaces.
The first character of the identifier is not an alphabetic character (as defined below).
The identifier contains a reserved word.
The identifier contains characters other than alphabetic characters and digits.
Alphabetic characters include the alphabet, as well as the underscore character (_), at sign (@), number sign (#), and dollar sign ($). The database collation sequence dictates which characters are considered alphabetic or digit characters.
The following characters are not permitted in identifiers:
Double quotes
Control characters (any character less than 0x20)
Double backslashes
You can use a single backslash in an identifier only if it is used as an escape character.
If the QUOTED_IDENTIFIER database option is set to OFF, double quotes are used to delimit SQL strings and cannot be used for identifiers. However, you can always use square brackets to delimit identifiers, regardless of the setting of QUOTED_IDENTIFIER. The default setting for the QUOTED_IDENTIFIER option is to OFF for Open Client and jConnect connections; otherwise the default is ON.
You can represent an apostrophe (single quote) inside an identifier by following it with another apostrophe.
Tables used with Component Integration Services (CIS) cannot have names longer than 30 bytes. This limit applies to tables referenced in cross-database joins, user-defined functions, or certain system functions, as well as tables created in the Catalog Store or ON SYSTEM, tables loaded using INSERT...LOCATION, and tables accessed via ISQL.
Column identifiers that start with at sign (@) are placeholders for the actual column name when they appear in column check constraints. Column identifiers that start with the at sign are not placeholders when they appear in table check constraints. For more information, see CREATE TABLE statement.
For a complete list of the reserved words, see “Reserved words”.
For information on the QUOTED_IDENTIFIER option, see “The quoted_identifier option”.
For additional restrictions on server and database names, see the section “Server command-line options” on page 7 in Chapter 1, “Running the Database Server” of the Sybase IQ Utility Guide.
The following are all valid identifiers.
Surname "Surname" [Surname] SomeBigName "Client Number"