Answer_Me
asked on
Enums in Sql-Server
Hi,
Can we have enums in sql-server? If not, is there any equivalent of enum in sql server.
I'm working on tsql and need to use enum in a particualar scenario in a stored procedure.
Thanks in Advance
Can we have enums in sql-server? If not, is there any equivalent of enum in sql server.
I'm working on tsql and need to use enum in a particualar scenario in a stored procedure.
Thanks in Advance
ASKER
This is one of feasible approach i already know but i don't want to go this way. coz there is an overhead of maintaing a table and insertions for this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CREATE TABLE SomeTable (
SomeEnumColumn varchar(10) not null
constraint CkSomeEnumColumn check (
SomeEnumColumn in ('Value1', 'Value2', 'Value3')
)
)
Hope that helps. If not, please post more specifics about what you are trying to do in the stored proc.