6
Reply

What is the difference between a check constraint and a rule?

Ankur Jain

Ankur Jain

Aug 18, 2014
2k
0

    The major difference between rule and Check is re usability. Check constraint is associated with columns in a Table. So these can't be re-used. Rules are defined with in a database and can be applied to any number of columns.

    suneel gupta
    December 27, 2016
    1

    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.

    Kml Surani
    May 13, 2015
    0

    Rules are a backward-compatibility feature that performs some of the same functions as CHECK constraints. CHECK constraints are the preferred, standard way to restrict the values in a column. CHECK constraints are also more concise than rules; there can only be one rule applied to a column, but multiple CHECK constraints can be applied. CHECK constraints are specified as part of the CREATE TABLE statement, while rules are created as separate objects and then bound to the column.

    Kml Surani
    May 13, 2015
    0

    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

    Abrar Ahmad Ansari
    March 10, 2015
    0

    http://www.codeproject.com/Questions/609687/DifferenceplusbetweenplusConstraintsplusandplusRul

    Munesh Sharma
    February 14, 2015
    0

    Check constraints and rules limit the range of values that a user can enter into a column. Whereas check constraints apply only to the table for which you enter them, you can apply rules to multiple tables.

    Ankur Jain
    August 18, 2014
    0