I have a SQL Server database with a time column which can only be filled with the text “am” or “pm” and I’m having trouble finding a constraint that would allow me to do this.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For SQL server you can use
CHECKconstraint which allows you to define a predicate that all the rows must meet in order to enter the table. Like so: