Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Statement case sensitive

Status
Not open for further replies.

abcfantasy

Programmer
Jun 3, 2006
110
DK
I've got an SQL SELECT statement which uses the WHERE clause and takes two parameters.

If for example the parameter is ABC, the Select command also returns those fields that match 'abc' and i don't want this.

I've got the following in the statement: WHERE ( field = @value )

How can i make it case sensitive?

Hope i was clear
Any help is appreciated

ABC -
 
Try putting the following statement into Google:

'make sql statement case sensitive'

and you'll find the answer in about 5 seconds.

Failing that, the statement you need is:

SELECT * FROM tablename WHERE columnname COLLATE Latin1_General_CS_AS = 'QUERY'

where 'QUERY' could also be 'query' or 'Query' or any other combination of upper and lower case thereof.
 
Thanks for the quick reply.

I had searched on google but i think i used wrong keywords.

Well thanks again i'll try that out as soon as I'll be home.

ABC -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top