How to write CHECK CONSTRAINT to allow only alphanumeric characters on EmpID column of table?
ALTER TABLE [Sample_Data]
ADD CONSTRAINT CK_Sample_Data CHECK(1=CASE WHEN PATINDEX('%[^a-zA-Z0-9]%',Empid)0
THEN 0 ELSE 1 END)
ALTER TABLE [Sample_Data]
ADD CONSTRAINT CK_Sample_Data CHECK(Empid NOT LIKE '%[^a-zA-Z0-9]%')
On this page of the site you can watch the video online SQL SERVER||Write Check Constraint to allow only alphanumeric characters on EmpID column of table? with a duration of hours minute second in good quality, which was uploaded by the user LearnSQLtoSSIS 13 March 2023, share the link with friends and acquaintances, this video has already been watched 221 times on youtube and it was liked by 4 viewers. Enjoy your viewing!