On the live server, we don’t have direct database access. However, while assisting another user recently, I noticed that they could access the database through some method — possibly via the Entity Store or a similar mechanism.
I received a request from the client’s reporting team to provide a way for them to retrieve the text values of enums from the database.
On my development environment, I can access enum values using the following two tables: EnumValueTable and EnumIdTable.
For example, the following T-SQL query returns the values for the SalesStatus enum:
SELECT * FROM EnumValueTable JOIN EnumIdTable ON EnumValueTable.EnumId = EnumIdTable.Id WHERE EnumIdTable.Name = 'SalesStatus' ORDER BY EnumValueTable.EnumValue;