I am considering the following with regards to implementing a check constraint on a column I am calling
year_month. My objective is to have a check constraint to enforce
- My intention is to create the column with data type:
varchar(7)example value that would be saved from my front end:
Would I then add a regular expression to enforce only numbers, dashes and max 7 in my check constraint setup? Or could I add some sort of regular expression to check for this pattern more exactly?