March 10, 2008 at 12:13 am
Hi ,
in my table i have values 'FAHEEM' and 'faheem',Now i have to select 'faheem' but SQL treat both as same ,
PLz suggest.
Best Regards
Faheem latif
Senior Database Architect
Genie Technologies (Pvt.) Ltd.
March 10, 2008 at 2:35 am
use the query:select column_name from table_name where cast(column_name as varbimary)=cast('FAHIEN' as varbinary):)
---
Thinking is the hardest work there is, which is the probable reason so few engage in it.
Sunitha
😎
March 10, 2008 at 3:27 am
faheemlatif (3/10/2008)
Hi ,in my table i have values 'FAHEEM' and 'faheem',Now i have to select 'faheem' but SQL treat both as same ,
PLz suggest.
You could also use the COLLATE keyword (e.g. if you do not want binary comparison, you still want to compare the strings based on language rules).
example:
select 1 where 'FAHEEM' = 'faheem' COLLATE SQL_Latin1_General_Cp1_CS_AS
The above will use the Latin1 collation with case sensitivity and accent sensitivity.
Regards,
Andras
March 10, 2008 at 5:11 am
And, Andras' method will allow an index to be used if there is one. The conversions to VarBinary will not.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 10, 2008 at 10:36 pm
Hi all,
Thanks for help full solution.
Best Regards
Faheem latif
Senior Database Architect
Genie Technologies (Pvt.) Ltd.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply