Is there some kind of mechanism in SQL Server to allow functions of type Enumerated type?
For example, if I have a Called “UpdateStatus” column, it usually gets the installation with single-letter values like this:
It can be compared to many things. This leads to confusion. An alternative is to have this row column as follows:
- Uploaded
- Removed
- Update
- Initialized
But this has its problems. In the end, someone is going to write something like this: where UpdateStatus = 'Initalized' (misspelled). Plus I heard that disabling strings is not that important.
So, is there any type of enumeration for SQL Server that can help with this? I basically look for compile time by checking that the value being compared (ie, “Initialized”) is part of the list of values.
I am using SQL Server 2008.
enumeration sql-server tsql sql-server-2008 enumerated-types
Vaccano
source share