Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 case sensitivity in T-sql.

Author  Topic 

raghava
Starting Member

3 Posts

Posted - 2006-01-27 : 05:31:19
hi
how to check case sensitivity in T-sql.
I need to distinguish upper & lower case values in table fields.

example:
--------
emp table having 3 cols
empid ename salary
1 xyz 3000
2 XYZ 4000

any body pls help

best regards
raghava

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-27 : 05:56:10
[code]
Declare @v1 varchar(10),@v2 varchar(10)
set @v1='xyz'
set @v2='XYZ'

select case when @v1=@v2 then 'Case Insensitive' else 'Case Sensitive' end
select case when convert(varbinary(10),@v1)=convert(varbinary(10),@v2) then
'Case Insensitive' else 'Case Sensitive' end[/code]

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -