[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


MySQL enum equivalent in MSSQL 2000

Posted on 2007-10-10
Medium Priority
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
Aneesh Retnakaran earned 320 total points
ID: 20048515
There is no concept of ENum in sql server (I heard that SQL 2008 has this feature ) .
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 360 total points
ID: 20048534
I agree. the clostest is here a CHAR(1) with a check contraint on the column, allowing only I and B as values.

Assisted Solution

Crag earned 320 total points
ID: 20048543
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.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

873 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