Data Integrity for multiple columns

  • How do I validate values of a table for two columns?

    for example, I have an employee table with a start date and an end date.

    how do I make sure that the start date is always equal or greater than end date when inserting and updating into that table?

    Edited by - bp on 03/11/2003 12:09:21 PM

  • Example:

    create table table_name

    (a datetime

    ,b datetime

    ,CONSTRAINT constraint_name CHECK ( a > b )

    )

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply