Rules (Transact-SQL)[1] are reusable what permitted to overcome the shortcoming of non-re-usability of check constraints.
And now I read [1] that:
- "This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. We recommend that you use check constraints instead. Check constraints are created by using the CHECK keyword of CREATE TABLE or ALTER TABLE"
So, what is instead of rules and why are they deprecated?
==== Update:
AlexKuznetsov, are table-level check constraints terribly slow?
Or, table-level check constraints using functions are slow in comparison with column-level check constraints and resp. rules as their equivalents (since rules are only column-level)?
In other words, are column-level check constraints and rules (implicitly being only column-level) are equal in performance?
Then, I see only removal of re-usability feature. The use of non-reusable table-level constraints were present before.
Also, I am more interested in knowing why and what to further expect then to know how to implement custom substitutes for deprecated system features using old features which had always been available before.
[1]
MS SQL Server 2008 R2 Books On Line. CREATE RULE (Transact-SQL)
http://msdn.microsoft.com/en-us/library/ms188064.aspx