Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    4

    Unanswered: "Limit to List" equivalent in SQL

    In Access, I can limit field options to a list. What is the equivalent in SQL 2005?

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    use a lookup table and enforce referential integrity.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    well, if it's a limited set, with ~0 likelihood of needing to be updated, you can also use a CHECK constraint

    for example
    Code:
    create table foo
    ( ...
    , gender char(1) null check (coalesce(gender,'M') in ('M','F'))
     ... )
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •