Difference between Constraints and Rules in SQL

Divakar picture Divakar · Jun 21, 2013 · Viewed 9.3k times · Source

What is the difference between using constraints and rules in SQL, preferably SQL server 2008 R2. Can anyone explain and demonstrate with a real time example

Answer

Dinup Kandel picture Dinup Kandel · Jun 21, 2013

There are a lot of difference but One the most notable difference is that we can bind rules to a datatypes whereas constraints are bound only to columns. this feature enable us to create our own data-type with the help of Rules and get the input according to that.

I have found a good example, check the following link. constraints vs rules