An implementation of the Jaro Winkler distance algorithm in Transact SQL
I've been wondering for months about how to implement this algorithm in Transact SQL, https://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance How can it be done? Maritim Today I finally stumbled upon this Stack Overflow-answer by leebickmtu showing an implementation in C#, originally ported from Java. I took the liberty to port it to a Transact SQL function, enjoy! IF OBJECT_ID (N'dbo.InlineMax', N'FN') IS NOT NULL DROP FUNCTION dbo.InlineMax; GO CREATE FUNCTION dbo.InlineMax(@valueOne int, @valueTwo int) RETURNS FLOAT AS BEGIN IF @valueOne > @valueTwo BEGIN RETURN @valueOne END RETURN