July 23, 2010 at 2:08 am
declare @ch1 char
declare @ch2 char
select @ch1='Ψ'
select @ch2='?'
IF(ASCII(@ch1)=ASCII (@ch2))
print 'hi ascii'
if(NCHAR(ASCII(@ch1))=NCHAR(ASCII (@ch2)))
print 'hi char'
IF(@ch1=@ch2)
print 'hi original'
///Can one help me out to fail the if condition with the same variales @ch1 and @ch2
thanks
sarat 🙂
Curious about SQL
July 23, 2010 at 2:21 am
Instead of CHAR try using NCHAR..
July 23, 2010 at 2:23 am
As in
declare @ch1 Nchar
declare @ch2 Nchar
select @ch1=N'?'
select @ch2=N'?'
IF(@ch1=@ch2)
print 'we are same'
else
print 'We are different'
Hope this helps
July 23, 2010 at 2:25 am
You can set like
select @ch1=N'?'
select @ch2=N'?'
July 23, 2010 at 2:27 am
Thanks 🙂
thanks
sarat 🙂
Curious about SQL
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply