Azure SQL Database now supports a powerful function called EDIT_DISTANCE_SIMILARITY that enables fuzzy string matching, helping developers find approximate matches in text data.
This function calculates the similarity between two strings based on the Levenshtein distance, returning a value between 0 (completely different) and 1 (identical). It's particularly useful for handling typos, variations in spelling, or partial name matches in datasets.
To use it, simply call EDIT_DISTANCE_SIMILARITY(string1, string2) in your SQL queries. For example:
SELECT EDIT_DISTANCE_SIMILARITY('John Smith', 'Jon Smith') AS Similarity;
This returns a high similarity score, helping you identify that the two strings likely refer to the same person.
This feature is part of Azure SQL's ongoing improvements to data quality and search capabilities. Developers can now build more robust data cleansing and matching logic without external tools.
For a hands-on demo, check out the companion video "Fuzzy String Matching Hands on in Azure SQL" on Cloud Guru Amit's channel.