471,075 Members | 1,253 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,075 software developers and data experts.

String case problem

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
3 1895
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

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
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.

Similar topics

3 posts views Thread by stanlo | last post: by
10 posts views Thread by Richard | last post: by
17 posts views Thread by Olivier Bellemare | last post: by
51 posts views Thread by Alan | last post: by
7 posts views Thread by VMI | last post: by
32 posts views Thread by tshad | last post: by
20 posts views Thread by karthikbalaguru | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.