enum data type in SQL2k

  • Hi,

    Does anyone know how can I use an enumeration data type in SQL 2000?

    It is known in MySQL where you ca define a table with enum data type like the following:

    CREATE TABLE table1(

    eid bigint not null,

    eetypeenum('Employee', 'Partner', 'Customer', 'POS', 'Client', 'Server', 'Database', 'Other') not null,

    )

    Is there any possibility in MSSQL to define enums?

    I am transforming MySQL scripts into MSSQL for a reason and need an advice.

    Thank you

    Cheers Ben

  • Just found an article on comparing MySQL->MSSQL data types, stating that enum types don't exist in MSSQL,however there is the possibility to use the CHECK function, like the following:

    CREATE TABLE table1(

    eid bigint not null,

    eetype varchar

    CHECK(eetype in('Employee',

    'Partner',

    'Customer',

    'POS',

    'Client',

    'Server',

    'Database',

    'Other')

    ) not null;

    Ben

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

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