473,324 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 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 1930
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: stanlo | last post by:
hi to everyone, this is still a follow up of my project ,mathematical expression.this project is meant to evaluate mathemtical expressions with oparators,+,-,*,/.more than two operands can be done,...
10
by: Richard | last post by:
Here is the program problem: Month with 30 days have 720 hours, and month with 31 days have 744 hours. February, with 28 days, has 672 hours. Enhance the input validation of the program code...
17
by: Olivier Bellemare | last post by:
I've tried to make a function that returns the middle of a string. For example: strmid("this is a text",6,4); would return "is a". Here is my code: char *strmid(char *texte, int depart,...
51
by: Alan | last post by:
hi all, I want to define a constant length string, say 4 then in a function at some time, I want to set the string to a constant value, say a below is my code but it fails what is the correct...
7
by: VMI | last post by:
If I have the string "Héllo", how can I replace char (é) with an 'e'? I cannot use the String.Replace() fuction. It has to be by replacing one char with another. Thanks.
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
8
by: tony | last post by:
Hello! I have below a for loop and a switch in the for loop. I have also a enum called colBlowStep with some values. I have also an array called m_columnBlowStep with some strings. All items in...
5
by: jeremyje | last post by:
I'm writing some code that will convert a regular string to a byte for compression and then beable to convert that compressed string back into original form. Conceptually I have.... For...
20
by: karthikbalaguru | last post by:
Hi, String constant being modifiable in C++ but, not modifiable in C. that is, In C++, the following example output will be "Mplusplus" char *str1 = "Cplusplus"; *str1 = 'M'; In C, the above...
3
by: kronus | last post by:
I'm receiving an xml file that has a child called modified and it represents a date value in the form of a string -- Nov 14, 2008 -- and in my app, I have items associated with each object and I'm...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.