Reputation: 9
I just looked now for hours how to allow only the characters w,p,s,v in my column. I wrote it like that but there is only every time a fail.
ALTER TABLE Personal ADD
CONSTRAINT Typ
CHECK (Typ like '%^[w,p,s,v]%');
ALTER TABLE Personal
DROP CONSTRAINT CHK_Typ;
I really need this help :(
Upvotes: 1
Views: 391
Reputation: 143103
How about
alter table personal add constraint ch_typ check (translate(typ, '.wpsv', '.') is null);
Upvotes: 1