SDU Tools: Levenshtein Distance in SQL Server T-SQL
Our free SDU Tools for developers and DBAs, now includes a very large number of tools, with procedures, functions, and views. The LevenshteinDistance function calculates the Levenshtein distance between two strings.
It essentially answers the question How far apart are these two strings in terms of character edits?, where edits are inserting, deleting, or substituting a character. In this calculation, each edit has a cost of 1.
Empty and NULL values on input return NULL.
2026-03-31
