| Author |
String case problem
|
|
| vishal 2005-11-30, 3:23 am |
| 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.
| |
|
| 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" < vishalkumarjain@gmai
l.com> wrote in message
news:1133336001.203540.29810@g47g2000cwa.googlegroups.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.
>
| |
|
|
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_C
P1_CS_AS ="vishal"
HTH, Jens Suessmeyer.
| |
| m.bohse@quest-consultants.com 2005-11-30, 3:23 am |
| Another workaround I used in SQL 7.0 a lot would be:
SELECT ENAME FROM EMPTABLE
WHERE CONVERT (varbinar(255),ENAME
) = CONVERT(varbinary(25
5),
'vishal')
Markus
|
|
|
|