The Rule object exposes the attributes of a single Microsoft® SQL Server™ data-integrity rule.
SQL Server offers several mechanisms for ensuring data integrity. A SQL Server rule is a Transact-SQL condition_expression syntax element that defines a data-integrity constraint. A rule can be bound to a column or user-defined data type. condition_expression is executed to validate data for a single column when a value is inserted into the column bound by the rule. For more information, see CREATE RULE.
With the Rule object, you can:
The Name property of a Rule object uses the SQL Server data type sysname. The value of the Name property must be unique for a database.
After you have created the rule, use the BindToColumn and BindToDatatype methods of the Rule object to apply the constraint to SQL Server columns and user-defined data types.
To create a SQL Server rule
To remove a rule from a SQL Server database
Note The Rule object is compatible with instances of SQL Server 2000 and SQL Server version 7.0. However, the Rule2 object extends the functionality of the Rule object for use with features that are new in SQL Server 2000.