sanjaykattimani
asked on
MS sql not sensitive??
my following query
> select * from users where userid="SAnjay"
fetches user "sanjay" also where as its wrong. any set up is there to set case sensitivity off?
> select * from users where userid="SAnjay"
fetches user "sanjay" also where as its wrong. any set up is there to set case sensitivity off?
ASKER
select * from users where userid="SAnjay" COLLATE SQL_Latin1_General_CP1_CS_ AS
generates following error
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'COLLATE'.
generates following error
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'COLLATE'.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks. it works. Is there any way to set it on so that it always compares all text with case sensitivity?
ASKER
Thanks. it works. Is there any way to set it on so that it always compares all text with case sensitivity?
Just install SQL Server 7.0 using "Custom Installation" method, pick collation SQL_Latin1_General_CP1_CS_ AS as a default collation during installation process. Textual data will be always compared using case sensitive comparison on this server.
A caveat, import existing data from server with conflicting collation settings will require two steps.
-- export existing data into a flat file(s)
-- import it into new server using Transact - SQL statement BULK INSERT or bcp.exe command line utility.
Cheers
A caveat, import existing data from server with conflicting collation settings will require two steps.
-- export existing data into a flat file(s)
-- import it into new server using Transact - SQL statement BULK INSERT or bcp.exe command line utility.
Cheers
select * from users where userid="SAnjay" COLLATE SQL_Latin1_General_CP1_CS_