Pre-upgrade tasks
62 Adaptive Server Enterprise
If you use either sqlupgrade or sqlupgraderes, they automatically install new
reserved words and
sp_checkreswords, which is a stored procedure used to
detect and display any identifiers in your existing databases that conflict with
reserved words in the new database. You can then run the new version of
sp_checkreswords at any time while preforming pre-upgrade tasks.
Note You must use the sp_checkreswords stored procedure from the new
version of Adaptive Server to verify that the old installation of Adaptive Server
does not use any reserved words that have been introduced with the new server.
Checking for reserved words generates a list of identifiers that conflict with
reserved words, and the owners of those identifiers, in the file
$SYBASE/$SYBASE_ASE/init/logs/sqlupgradeMMDD.nnn. Review this file to
determine which identifiers must be changed.
Addressing reserved words conflicts
If any database names are reserved words, you must use sp_renamedb to
change the database names before you can upgrade. Use
sp_dboption to set the
database to single-user mode, and then run
sp_renamedb, specifying the new
name. See the Reference Manual for more information on these procedures.
If other identifiers are reserved words, you can use:
•
sp_rename to change the name of the object, before or after the upgrade.
• Quoted identifiers.
• Brackets around the identifier. For example:
create table [table] ( [int] int, [another int] int )
Run sp_checkreswords in master and in each user database to display the names
and locations of conflicting identifiers.
For more information about
sp_rename and sp_checkreswords and methods for
avoiding reserved word conflicts, see the Reference Manual.
Using quoted identifiers
You can enclose the identifiers that are reserved words in double quotation
marks and invoke the
quoted_identifier option of the set command in
procedures and queries that include the reserved words. The
set
quoted_identifier
option tells Adaptive Server to treat any character string
enclosed in double quotation marks as an identifier.