Removes one or more user-defined rules from the current database.
DROP RULE {rule} [,...n]
To drop a rule, first unbind it if the rule is currently bound to a column or to a user-defined data type. Use sp_unbindrule to unbind the rule. If the rule is bound when attempting to drop it, an error message is displayed and the DROP RULE statement is canceled.
After a rule is dropped, new data entered into the columns previously governed by the rule is entered without the rule’s constraints. Existing data is not affected in any way.
The DROP RULE statement does not apply to CHECK constraints. For more information about dropping CHECK constraints, see ALTER TABLE.
DROP RULE permission defaults to the rule owner and is not transferable. However, members of the db_owner fixed database role or sysadmin fixed server role can drop any object by specifying the owner in DROP RULE.
This example unbinds and then drops the rule named pub_id_rule.
USE pubs
IF EXISTS (SELECT name FROM sysobjects
WHERE name = 'pub_id_rule'
AND type = 'R')
BEGIN
EXEC sp_unbindrule 'publishers.pub_id'
DROP RULE pub_id_rule
END
GO
ALTER TABLE | sp_help |
CREATE RULE | sp_helptext |
USE | sp_unbindrule |
sp_bindrule |