Possible Duplicate:
Does SQL Server 2005 have an equivalent to MySql’s ENUM data type?
Is there any way to define ENUM in SQL Server 2005?
I have fixed values which I need to use in procedures and functions.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use one or more scalar UDFs?
One per constant:
dbo.CONST_Bicyclereturns 1dbo.CONST_Carreturns 2One per enum:
dbo.CONST_Types('Bicycle')returns 1dbo.CONST_Types('Car')returns 2Or use a table with ID, Name per enum
Use a client side enum to match this (perhaps with validation against the table solution)
There is no quick or clean way to do this like there is in .net (as per your comment).