use hashbytes
declare @first_value nvarchar(1) = 'a' declare @second_value navarchar(1) = 'A' if HASHBYTES('SHA1',@first_value) = HASHBYTES('SHA1',@second_value) begin print 'equal' end else begin print 'not equal' end
... in the where section
declare @example table (ValueA nvarchar(1), ValueB nvarchar(1)) insert into @example (ValueA, ValueB) values ('a', 'A'), ('a', 'a'), ('a', 'b') select ValueA + ' = ' + ValueB from @example where hashbytes('SHA1', ValueA) = hashbytes('SHA1', ValueB)
or find the meaning
declare @value_b nvarchar(1) = 'A' select ValueB + ' = ' + @value_b from @example where hashbytes('SHA1', ValueB) = hasbytes('SHA1', @value_b)
Dub Mar 23 '15 at 17:48 2015-03-23 โโ17:48
source share