MySQL enum equivalent in MSSQL 2000

Posted on 2007-10-10
Last Modified: 2008-01-09
What is the equivalent of this MySQL statement in MSSQL 2000?

create table customer
 (cust_id integer IDENTITY (1, 1) not null,
  fed_id varchar(12) not null,
  cust_type_cd enum('I','B') not null,
  address varchar(30),
  city varchar(20),
  state varchar(20),
  postal_code varchar(10),
  constraint pk_customer primary key (cust_id)
Question by:sepknow
    LVL 75

    Assisted Solution

    by:Aneesh Retnakaran
    There is no concept of ENum in sql server (I heard that SQL 2008 has this feature ) .
    LVL 142

    Accepted Solution

    I agree. the clostest is here a CHAR(1) with a check contraint on the column, allowing only I and B as values.
    LVL 5

    Assisted Solution

    i don't believe such a data type exists in SQL Server. This would be done using a character data type with a check  constraint.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
    The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
    Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
    Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now