My constraint:
(datalength([Firstname])>=(2) AND datalength([Firstname])<=(50) AND (NOT [Firstname] like '%[^a-zA-Z]%' AND NOT [Firstname] like N'%[^ა-ზ]%'))
Adding first name with Georgian letters causes error:
What's wrong?
My constraint:
(datalength([Firstname])>=(2) AND datalength([Firstname])<=(50) AND (NOT [Firstname] like '%[^a-zA-Z]%' AND NOT [Firstname] like N'%[^ა-ზ]%'))
Adding first name with Georgian letters causes error:
What's wrong?
I don't know anything about Georgian names, but perhaps your choice of first and last letters isn't appropriate for your collation. Perhaps the best idea is to just list all the characters allowed. Instead of:
N'%[^ა-ზ]%'
Perhaps something like this:
N'%[^ႠႡႢႣႤႥႦႧႨႩႪႫႬႭႮႯႰႱႲႳႴႵႶႷႸႹႺ'
+N'ႻႼႽႾႿჀჁჂჃჄჅჇჍაბგდევზთიკლმნოპჟრს'
+N'ტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶჷჸჹჺჼჽჾჿⴀⴁⴂⴃⴄⴅ'
+N'ⴆⴇⴈⴉⴊⴋⴌⴍⴎⴏⴐⴑⴒⴓⴔⴕⴖⴗⴘⴙⴚⴛⴜⴝⴞⴟⴠⴡⴢ'
+N'ⴣⴤⴥⴧⴭ]%'
Other than that, make sure that all your logical operators, AND
's, NOT
's and OR
's are appropriate.
You may want to consider if this limitation is appropriate for your needs. Names of humans can be more diverse than you might ever think. Google "Falsehoods Programmers Believe About Names
"