ALTER TABLE UserRegistration
WITH CHECK ADD
CONSTRAINT chkUserEmail
CHECK
(
CHARINDEX(' ',LTRIM(RTRIM([Email]))) = 0 -- No embedded spaces
AND CHARINDEX('''', Email)=0
AND charindex('(', Email)=0 AND charindex(')', Email)=0
AND LEFT(LTRIM([Email]),1) <> '@' -- '@' can't be the first character of an email address
AND RIGHT(RTRIM([Email]),1) <> '.' -- '.' can't be the last character of an email address
AND CHARINDEX('.',[Email],
AND LEN(LTRIM(RTRIM([Email]))) - LEN(REPLACE(LTRIM(RTRIM([
AND CHARINDEX('.',REVERSE(LTRIM(
AND (CHARINDEX('.@',[Email]) = 0 AND CHARINDEX('..',[Email]) = 0) -- can't have patterns like '.@' and '..'
)
No comments:
Post a Comment