i want to implement a constraint on a db for table of example if i have a table like empno, empname, city ,And I have an enumerations like, dallas,austin and newyork for the city and the default being dallas. But i dont want to anything else than these three cties to be entered from the backend. . I know I could maintain a lookup table and and put a foreignkey, Second option would be creating a trigger may be?
Is there any other way ee could acheive it. Like having a check constraint or something, if so will it hold multiple varchar values ?
Foreign key would be the best way to do this, as you have already done an enumeration, so there's your key!
You can use a check constraint
or without enums
answered Jan 03, 2012 at 08:48 AM
Kev Riley ♦♦