Search for lowercase instances in a case-insensitive column

I have a table in my SQL Server 2005 database that contains customer IDs.  Example:
CULSTA2
culsta2
BILBOA
SUNSUP
AQUCON
aqucon

and so on.  I need to be able to identify anytime there's an entry of any lower case entry, separate from the correct entry of all upper case.  My database is set as case-insensitive but the application that uses it interprets the data differently if it is lower case rather than all upper case.

So in the set shown above, I'd just be looking for culsta2 and aqucon, and NOT CULSTA2 or AQUCON.

Help?
Thanks
Van

ngwslsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sgvillCommented:
Anytime you use it, you could send it as UPPER(ID).  
0
Rajkumar GsSoftware EngineerCommented:
SELECT * FROM urTable WHERE urfield = LOWER(urfield) COLLATE SQL_Latin1_General_CP1_CS_AS

Raj
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sgvillCommented:
oops. misread what you wrote.  You can use a query like this:

select * from yourtable where cast(ID as varbinary(100)) <> cast(upper(ID) as varbinary(100))

and your varbinary can be as small as your IDs are
0
ngwslsAuthor Commented:
Perfect!  It worked!  Thanks so much!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.