I want to create a check constraint for state abbreviations. I only want to allow a two character insert for the State column. What would be the code? my code was: State VARCHAR(2) NOT NULL CONSTRAINT CK_StateAbbr CHECK (State like 'xx')
I am assuming putting the xx in there will only allow xx for the state. Would I put CHECK (State like '[A-Z][A-Z]')?