views:

56

answers:

3
+4  Q: 

String comparison

When comparing two strings how to avoid checking if a string is of different case in MS SQL 2000

Example:

String1 = Anish
String2 = anish

When comparing Anish = anish the result will be "the strings are not equal".How we camapre these strings in that way?

+1  A: 

Change the collation of the strings to some form of CI (case insensitive).

E.g. COLLATE Latin1_General_CI_AS

Randolph Potter
+4  A: 

Here is some information about case sensitivity. The thing that i can see is that the problem is how the server is installed.

Case sensitive search

Arto Uusikangas
A: 

Try the following queries seperately in Northwind database:

SELECT *  FROM dbo.Customers  WHERE Country COLLATE SQL_Latin1_General_CP1_CS_AS  ='Germany'

SELECT *  FROM dbo.Customers  WHERE Country COLLATE SQL_Latin1_General_CP1_CS_AS  ='geRmany'
Himadri

related questions