Removes a user-defined rule.
drop rule [owner.]rule_name[, [owner.]rule_name] ...
is the name of the rule to drop. Specify the owner’s name to drop a rule of the same name owned by a different user in the current database. The default value for owner is the current user.
Removes the rule pubid_rule from the current database:
drop rule pubid_rule
Before dropping a rule, unbind it using sp_unbindrule. If the rule has not been unbound, an error message appears, and the drop rule command fails.
You can bind a new rule to a column or user-defined datatype without unbinding its current rule. The new rule overrides the old one.
After you drop a rule, Adaptive Server enters new data into the columns that were previously governed by the rule without constraints. Existing data is not affected in any way.
ANSI SQL – Compliance level: Transact-SQL extension.
The permission checks for drop rule differ based on your granular permissions settings.
Granular permissions enabled |
With granular permissions enabled, you must be the rule owner or a user with drop any rule privilege. |
Granular permissions disabled |
With granular permissions disabled, you must be the rule owner or a user with sa_role. |
Values in event and extrainfo columns of sysaudits are:
Event |
Audit option |
Command or access audited |
Information in extrainfo |
---|---|---|---|
30 |
drop |
drop rule |
|
Commands create rule
System procedures sp_bindrule, sp_help, sp_helptext, sp_unbindrule