Removes a user-specified rule from a database.
The DROP RULE statement does not apply to CHECK constraints. For details about dropping CHECK constraints, see the ALTER TABLE statement.
DROP RULE [owner.]rule_name [, [owner.]rule_name...]
where
To drop a rule, you must first unbind it if it is currently bound to a column or to a user-defined datatype. Use the sp_unbindrule system stored procedure to unbind the rule. If the rule is bound when you try to drop it, an error message is displayed and the DROP RULE statement is canceled.
After you drop a rule, new data entered into the columns previously governed by the rule is entered without these constraints. Existing data is not affected in any way.
DROP RULE permission defaults to the rule owner and is not transferable. However, the database owner and system administrator can drop any object by specifying the owner in the DROP RULE statement. The system administrator and database owner can also use the SETUSER statement to impersonate another user.
This example unbinds and then drops the pub_id rule.
sp_unbindrule 'publishers.pub_id' go DROP RULE pub_id_rule
CREATE RULE | sp_helptext |
sp_bindrule | sp_unbindrule |
sp_help |