uso 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
-- output:
-- not equal
... en donde cláusula
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)
-- output:
-- a = a
select ValueA + ' <> ' + ValueB
from @example
where hashbytes('SHA1', ValueA) <> hashbytes('SHA1', ValueB)
-- output:
-- a <> A
-- a <> b
o para encontrar un valor
declare @value_b nvarchar(1) = 'A'
select ValueB + ' = ' + @value_b
from @example
where hashbytes('SHA1', ValueB) = hasbytes('SHA1', @value_b)
-- output:
-- A = A
Este enlace puede ayudarlo http://www.codefari.com/2015/09/case-sensitive-search-on-column-in-sql.html – Singh