Upgrading compiled objects with dbcc upgrade_object
114 Adaptive Server Enterprise
• dbid – specifies the database ID. If you do not specify dbid, all compiled
objects in the current database are upgraded.
•
dbname – specifies the database name. If you do not specify dbname, all
compiled objects in the current database are upgraded.
•
compiled_object_name – is the name of a specific compiled object you
want to upgrade. If you use the fully qualified name,
dbname and database
must match, and you must enclose the fully qualified name in quotes. If
the database contains more than one compiled object of the same name,
use the fully qualified name. Otherwise, all objects with the same name are
parsed, and if no errors are found, upgraded.
•
check – upgrades all check constraints and rules. Referential constraints
are not compiled objects and do not require upgrading.
•
default – upgrades all declarative defaults and the defaults created with the
create default command.
•
procedure – upgrades all stored procedures.
•
rule – upgrades all rules and check constraints.
•
trigger – upgrades all triggers.
•
view – upgrades all views.
The keywords
check, default, procedure, rule, trigger, and view specify the
classes of compiled objects to be upgraded. When you specify a class, all
objects in that class, in the specified database, are upgraded, provided that
dbcc upgrade_object finds no errors or potential problem areas.
•
force specifies that you want to upgrade the specified object even if it
contains a
select * clause. Do not use force unless you have confirmed that
the
select * statement will not return unexpected results. The force option
does not upgrade objects that contain reserved words, contain truncated or
missing source text, refer to nonexistent temporary tables, or do not match
the quoted identifier setting. You must fix these objects before they can be
upgraded.
Note If set quoted identifiers is on, use single quotes around the keywords. If
set quoted identifiers is off, you can use either double quotes or single quotes.
Examples Example 1 Upgrades all compiled objects in the active database:
dbcc upgrade_object