Damerau–Levenshtein distance in SQL

Couple of years ago I needed to implement a kind of fuzzy matching algorithm in SQL Server. Today I have just found my code I implemented it in SQL 2005 and it works on newer versions as well. Code is based on the Damerau–Levenshtein distance algorithm. I was using a SQL CLR user defined scalar function: inputs are 2 strings and returns a number between 0 and 1. If it is more close to 1 it means the two input strings are closer to each other. Of course SSIS Fuzzy Lookup Transformation may work b... [More]