RENAME CONSTRAINT statement
Use the RENAME CONSTRAINT statement to rename the constraint. This statement is an extension to the ANSI/ISO standard for SQL.
Syntax
Element | Description | Restrictions | Syntax |
---|---|---|---|
new_constraint | New name that you declare here for old_constraint | Name must be unique to the database | Identifier |
old_constraint | Constraint name that new_constraint replaces | Must exist, but it cannot be a constraint on a system catalog table | Identifier |
owner | Owner of old_constraint | Must be the owner of old_constraint | Owner name |
Usage
You can rename a constraint if any of the following is true:
- You are the owner of the constraint.
- You have the DBA privilege on the database.
When you rename a constraint, the database server changes the constraint name in the sysconstraints and sysobjstate system catalog tables.