troubleshooting Question

How do I limit the choices in a SQL Server column

Avatar of Member_2_8198376
Member_2_8198376 asked on
Microsoft SQL ServerASP.NET* ASP.NET Core* Entity Framework Core
3 Comments1 Solution103 ViewsLast Modified:
In SQL Server management studio, I have a table called, Common.
Common has a column called, FLSA.
The FLSA column can only have one of two values entered:
1. Exempt
2. Non-Exempt
If I use a Check Constraint, then it will be more difficult for my Asp.Net web application's Entity Framework to pull the choices when I want to populate a drop down list in the HTML.
If I use a reference table called FLSA, do I add those two values directly and then create a relationship between the Common table and the FLSA table; OR do I use a check constraint on the FLSA table?
If I add the two values directly to the FLSA table, do I need a separate primary key field like Flsa_Id OR can I just make the FLSA column itself the primary key?
If I make the FLSA column of the FLSA table the primary key, how do I prevent any application from adding more values. There should only be those two values unless I manually change it through SSMS.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros