September 9, 2014 at 11:36 pm
I am reading Joe celko's sql for smarties and in that he specifies a technique to check a column has only non-alphabets entered
CREATE TABLE alpha(allalpha varchar(100) CHECK(UPPER(allalpha)=LOWER(allalpha)))
but when I run this in sql server 2008 it allows all alphabets and non-alphabets. I know there is another method using LIKE predicate. But am I missing something or the code need any changes?
September 10, 2014 at 12:15 am
Isn't it a problem of case insensitive collation ?
September 10, 2014 at 12:39 am
Well the db is in CI collation. But now I changed the collation (Latin1_General_100_CS_AI) and checked but the same thing happened.
September 10, 2014 at 2:03 am
In a new database, with sensitive collation, the check constraint works fine.
How did you change the collation ?
September 10, 2014 at 4:36 am
yup that worked , so this only works for a CS collation. Thanks helping Roland
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply