You can use quoted identifiers for:
Tables
Views
Column names
Index names (Adaptive Server version 15.7 and later)
System procedure parameters (Adaptive Server version 15.7 and later)
To enable Adaptive Server to use quoted identifiers:
Set the enable functionality group or quoted identifier enhancement configuration parameters to 1. For example:
sp_configure "enable functionality group", 1
Turn on quoted_identifier for the current session:
set quoted_identifier on
When you enable this feature, the query processor removes
delimiters and trailing spaces from object definitions when you
include quoted identifiers. For example, Adaptive Server considers "ident"
, [ident]
,
and ident
to be identical.
If this feature is not enabled, "ident"
is
considered as an identifer that is distinct from the other two.
When you start Adaptive Server with this feature enabled:
Objects you create with quoted identifiers before restarting Adaptive Server with the enable functionality group configuration parameter enabled are not automatically accessible when you use quoted identifiers after starting the server with this parameter enabled, and vice versa. That is, Adaptive Server does not automatically rename all database objects.
However, you can use sp_rename to
manually rename objects. For example, if you create an object named "ident"
and
then restart Adaptive Server with this feature enabled, rename the
object by issuing:
sp_rename '"ident"', 'ident'
Adaptive Server started with this feature enabled
treats [tab.dba.ident]
and "tab.dba.ident"
as
fully qualified names.
Any Transact-SQL statements, functions, and system or stored procedures that accept identifiers for objects also work with delimited identifiers.
When you start Adaptive Server with this feature enabled, the valid_name function distinguishes strings that are valid for identifiers under normal rules from those that are valid under the rules for delimited identifiers, with a nonzero return indicating a valid name.
For example, valid_name('ident/v1')
returns
true (that is, a nonzero value) for valid names, using the rules
for quoted identifiers. Identifiers that are valid using regular
rules also return true (nonzero). Identifiers that are only valid
using the quoted identifier rules that are distinguished by the value
128 (0x80).
When you use quoted identifiers, identifiers in Adaptive Server that can normally be 255 bytes long are limited to 253 bytes, while identifiers normally restricted to 30 bytes are limited to 28 bytes.
Some identifiers may have additional constraints if they relate to items outside Adaptive Server. For example, Sybase recommends that you use only ASCII alphanumeric characters for server names, because these names are used with directory services where external character set and syntax rules may apply ($SYBASE/interfaces, LDAP, and so on).