DROP RULE Statement

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.

Syntax

DROP RULE [owner.]rule_name [, [owner.]rule_name...]

where

rule_name
Specifies the rule to be removed.

Remarks

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.

Permission

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.

Example

This example unbinds and then drops the pub_id rule.

sp_unbindrule 'publishers.pub_id'
go
DROP RULE pub_id_rule

See Also

CREATE RULE sp_helptext
sp_bindrule sp_unbindrule
sp_help