This is a discussion on How to compare the string with case sensitive in sql server? within the Database Support forums, part of the Web Development category; How to compare the string with case sensitive in sql server?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| How to compare the string with case sensitive in sql server?
__________________ Krishnakumar.S Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily |
| Sponsored Links |
| |||
| Yes...for that you can use encrypt function.
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| |||
| Hey buddy, Can you show the code how to do that?
__________________ Krishnakumar.S Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily |
| |||
| Yeah..sure... Code: declare @Test int
if((encrypt('test')=encrypt('Test')))
set @Test=1
else if((encrypt('test')!=encrypt('Test')))
set @Test=0
select @Test as Result
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| |||
| hey buddy, I tried your way. But there is no "encrypt" function. ![]()
__________________ Krishnakumar.S Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily |
| |||
| Is it? what version of sql server have you using?
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| |||
| Oh mate! I think this is available only in 2000 ![]()
__________________ Krishnakumar.S Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily |
| |||
| Yes mate... this is only in 2000. I will try and let u know whether I came to know the solution.
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| |||
| select case when (cast('UPPER' as varbinary(max)) = cast('upper' as varbinary(max))) then 'same' else 'different' end OR select case when 'UPPER' COLLATE Latin1_General_CS_AS = 'upper' THEN 'SAME' ELSE 'DIFFERENT' END |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compare a string with String Array. | oxygen | C# Programming | 5 | 12-28-2007 11:18 PM |
| What is diffrenece between string.compare and string.compareordinal | shaalini | ASP and ASP.NET Programming | 3 | 12-28-2007 10:46 PM |
| Case sensitive comparison in mysql? | velhari | Database Support | 1 | 12-04-2007 01:29 AM |
| XML case-sensitive | vigneshgets | C# Programming | 2 | 07-12-2007 05:18 AM |
| Handle Case Sensitive Search in MySQL | priyan | Database Support | 6 | 07-10-2007 07:21 AM |