By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,930 Members | 1,323 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,930 IT Pros & Developers. It's quick & easy.

String case problem

P: n/a
I am using a select statement like
SELECT ENAME FROM EMPTABLE WHERE ENAME ="vishal"

I am getting the result as 1 row affected.

Ename
----------
Vishal
The Problem is the query I have passed is "vishal"(lower case) and
getting the output as "Vishal"(V is Upper Case)

How do I solve this problem if I want to go with case sensitive
retrival of data.

I have gone thru some string functions available but could not find
one.
Any help would be appreciated..
regards
vishal.

Nov 30 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
MC
Check for the COLLATION in books online. Your setting is obviously CI (case
insensitive).
If you want just for the query to be case sensitive you can specify
collation in the select statement. Check for COLLATE option for this.
MC
"vishal" <vi*************@gmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
I am using a select statement like
SELECT ENAME FROM EMPTABLE WHERE ENAME ="vishal"

I am getting the result as 1 row affected.

Ename
----------
Vishal
The Problem is the query I have passed is "vishal"(lower case) and
getting the output as "Vishal"(V is Upper Case)

How do I solve this problem if I want to go with case sensitive
retrival of data.

I have gone thru some string functions available but could not find
one.
Any help would be appreciated..
regards
vishal.

Nov 30 '05 #2

P: n/a

if you want to search CASE Sensitive you have to change the coallation
of your column / table or Query:

CS_AS means (C)ase (S)ensitive, (A)ccent (S)ensitive

SELECT ENAME FROM EMPTABLE WHERE ENAME COLLATE
SQL_Latin1_General_CP1_CS_AS ="vishal"
HTH, Jens Suessmeyer.

Nov 30 '05 #3

P: n/a
Another workaround I used in SQL 7.0 a lot would be:
SELECT ENAME FROM EMPTABLE
WHERE CONVERT (varbinar(255),ENAME ) = CONVERT(varbinary(255),
'vishal')

Markus

Nov 30 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.