Thursday, 8 August 2013

Test for Upper Case - T-Sql

Test for Upper Case - T-Sql

All,
How can I check if a specified varchar character or entire string is upper
case in T-Sql? Ideally I'd like to write a function to test if a character
is upper case, then I can later apply that to a generic varchar. It should
return false for non alphabetic characters. I am only interested in
english language characters.
I am working with T-sql in SQL Management Studio, and I have tried pulling
records beginning with a lower case letter from a table in this fashion:
select * from TABLE
where SUBSTRING(author,1,1) != LOWER(SUBSTRING(author,1,1))
Which returns 0 records, but I know there are records beginning with upper
and lower case letters.
Thanks

No comments:

Post a Comment