But some time we need to search case sensitive then i show you some example for it...
First create one table.
CREATE TABLE [dbo].[checkName](
[Id] [int] IDENTITY(1,1) PRIMARY KEY,
[Cname] [varchar](100)
and execute above script.
then insert some records in above table.
insert into checkName (Cname) values('Anil')
insert into checkName (Cname) values('aNil')
insert into checkName (Cname) values('anIl')
insert into checkName (Cname) values('aniL')
insert into checkName (Cname) values('AnIl')
execute above script.
then execute below script for finding value of 'aniL'
select *
from checkName
where BINARY_CHECKSUM(Cname) = BINARY_CHECKSUM('aniL')
-------------------------------------------------------------------------------------------
select *
from checkName
where Cname = 'aniL' COLLATE SQL_Latin1_General_CP1_CS_AS
-------------------------------------------------------------------------------------------
select *
from checkName
where CAST(Cname AS varbinary(100)) = CAST('aniL' AS varbinary(100))
-------------------------------------------------------------------------------------------Output will be....
Id Cname
4 aniL