Limiting Values

  • Is there a way to restrict the values in a field to a specific two or three?

    I have a field where I want the only allowable values to be "A", "I", and "U".

    Thanks

  • Do this with a check constraint. Ex.

    ALTER TABLE tableX WITH NOCHECK

    ADD CONSTRAINT limitvalue CHECK (columnx IN ('A','I','U')

    If you want to have check table at creation chnage NOCHECK to CHECK

    See BOL for more help.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

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

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