-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
  • 21,409
  • 40
  • 127
  • 196

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
  • 4,061
  • 1
  • 17
  • 27