Link to home
Start Free TrialLog in
Avatar of Jack Seaman
Jack SeamanFlag for United States of America

asked on

How do I creat a check constraint to prevent updates/insertions of certain characters?

I want to create a check constraint on a table to prevent updates/insertions of certain characters.  I tried this but did not work:  name not like '%<%>%'.
Avatar of tigin44
tigin44
Flag of Türkiye image

As I understand you want to prevent the enter of "<" and ">" characters so try this

PATINDEX('%[<->]%', 'ABC>D<EF') = 0
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial