-1

I have the following sql code:

if ('aaa' = 'aAa') 
    print 'equals'
else
    print 'not equals'

And it prints equals. Why it's this behavior when the strings are not equals?

Buda Gavril
  • 20,719
  • 39
  • 122
  • 185

1 Answers1

0

Use collations :

IF 'aaa' COLLATE Latin1_General_CS_AS = 'aAa' COLLATE Latin1_General_CS_AS
 print 'equals'
else
 print 'not equals'
Mansoor
  • 3,820
  • 1
  • 16
  • 27