#1
  1. Y? Y!?
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2003
    Location
    Brisbane, Australia
    Posts
    1,573
    Rep Power
    48

    Question enum-equivalent data type for MS SQL 2000


    Hello,

    I understand that there is no ENUM data type in MS SQL 2000. Is there a way of converting a MySQL table that has ENUM's to a similar table in MS SQL?

    For example, if I have a column 'month_number' that can hold values between 1 and 12 I would use

    CREATE TABLE example_table (
    other column info...,
    month_number ENUM ('1','2', ... etc to '12'),
    other column info...,
    );

    for a MySQL table creation statement. How could I do something similar in MS SQL 2000? I have other ENUM columns with text as well.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2003
    Location
    Paris Uppland
    Posts
    2,377
    Rep Power
    391
    Code:
    CREATE TABLE example_table (
    other column info...,
    month_number smallint
    check (mont_number  in (1,2, ... etc to 12)),
    other column info...,
    )
    There you are, all standard SQL.

IMN logo majestic logo threadwatch logo seochat tools logo