Possible duplicate:Does SQL Server 2005 have an ENUM data type equivalent for MySql & rsquo?
Is there a way to define ENUM in SQL Server 2005?
I have fixed values that I need to use in procedures and functions.
Use one or more scalar UDFs?
One per constant:
dbo.CONST_Bicycle
dbo.CONST_Car
One to list:
dbo.CONST_Types('Bicycle')
dbo.CONST_Types('Car')
Or use a table with an identifier, name for listing
Use client-side enumeration to match this (possibly with checking for table resolution)
, .net( ).
, LuVehicle .
1,Bicycle 2,Car 3,MotorCycle
foriegn Id , .
, LuVehicle. -
select empname, vehicleId, LuVehicle.Name from employees, LuVehicle where employees.vehicleId = LuVehicle.Id
SQL Server supports user-defined data types. You might want to do something with CREATE TYPE (Transact-SQL) . But I do not know, even if it is possible through user data types and is not aware of its pros and cons. Maybe someone else will shed more light on him.