Posted: 3/28/2010 1:16:40 PM
In SQL usually when I search something the search is case insensitive like if I search for George it will give these results
George
george
geORGE
etc..
Now I need to put a search which is case sensitive search like for me in the above example it should give only the "George" as output.
Posted: 4/5/2010 8:41:24 AM
Hi,
http://www.mssqltips.com/tip.asp?tip=1032
http://sqlserver2000.databases.aspfaq.com/how-can-i-make-my-sql-queries-case-sensitive.html
good luck
Posted: 4/19/2010 9:46:29 PM
DECLARE @TestTable TABLE ([Character] CHAR(1)) INSERT @TestTable VALUES('a') INSERT @TestTable VALUES('A') INSERT @TestTable VALUES('b') INSERT @TestTable VALUES('B') INSERT @TestTable VALUES('c') INSERT @TestTable VALUES('C') INSERT @TestTable VALUES('d') INSERT @TestTable VALUES('D') DECLARE @TargetTable TABLE ([TargetColumn] VARCHAR(20) COLLATE Latin1_General_CS_AS) INSERT INTO @TargetTable SELECT t1.[Character] + t2.[Character] + t3.[Character] FROM @TestTable t1 CROSS JOIN @TestTable t2 CROSS JOIN @TestTable t3 --NOW TEST SELECT [TargetColumn] FROM @TargetTable WHERE TargetColumn LIKE ('AA%') --OUTPUT --AAa --AAA --AAb --AAB --AAc --AAC --AAd --AAD SELECT [TargetColumn] FROM @TargetTable WHERE TargetColumn LIKE ('Aa%') --OUTPUT --Aaa --AaA --Aab --AaB --Aac --AaC --Aad --AaD SELECT [TargetColumn] FROM @TargetTable WHERE TargetColumn='AaA' --OUTPUT --AaA
The heart is at COLLATE Latin1_General_CS_AS