Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

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.


Report this thread to moderator Post Follow-up to this message
Old Post
vishal
11-30-05 08:23 AM


Re: String case problem
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.
>



Report this thread to moderator Post Follow-up to this message
Old Post
MC
11-30-05 08:23 AM


Re: String case problem
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.


Report this thread to moderator Post Follow-up to this message
Old Post
Jens
11-30-05 08:23 AM


Re: String case problem
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


Report this thread to moderator Post Follow-up to this message
Old Post
m.bohse@quest-consultants.com
11-30-05 08:23 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 11:18 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006