2. Introducing SQL : SQL Naming and Statement Rules : Regular and Delimited Identifiers : Restrictions on Identifiers
 
Share this page                  
Restrictions on Identifiers
The following table lists the restrictions for regular and delimited identifiers (the names assigned to database objects):
Restrictions
Regular Identifiers
Delimited Identifiers
Quotes
Specified without quotes
Specified in double quotes
Keywords
Cannot be a keyword
Can be a keyword
Valid special characters
“At” sign (@)
(not ANSI/ISO)
Crosshatch (#)
(not ANSI/ISO)
Dollar sign ($)
(not ANSI/ISO)
Underscore (_)
Ampersand (&)
Asterisk (*)
“At” sign (@)
Backslash (\)
Braces ({ })
Caret (^)
Colon (:)
Comma (,)
Crosshatch (#)
Dollar sign ($)
Double quotes (")
Equal sign (=)
Exclamation point (!)
Forward slash (/)
Left and right caret (< >)
Left and right parentheses
Left quote (ASCII 96 or X'60')
Hyphen (-)
Percent sign (%)
Period (.)
Plus sign (+)
Question mark (?)
Semicolon (;)
Single quote (')
Space
Tilde (~)
Underscore (_)
Vertical bar (|)
The following characters cannot be embedded in object names using either regular or delimited identifiers:
DEL (ASCII 127 or X'7F')
To specify double quotes in a delimited identifier, repeat the quotes.
For example:
"""Identifier""Name"""
is interpreted as:
"Identifier"Name"
Trailing spaces are deleted from object names specified using delimited identifiers.
For example:
CREATE TABLE "space test " (scolumn INT);
creates a table named, space test, with no trailing blanks (leading blanks are retained).
If an object name composed entirely of spaces is specified, the object is assigned a name consisting of a single blank. For example, the following creates a table named “ ”.
CREATE TABLE "     " (scolumn INT);