Skip to content

Instantly share code, notes, and snippets.

View coquito77's full-sized avatar
💭
I may be slow to respond.

coquito77

💭
I may be slow to respond.
View GitHub Profile
@paulirwin
paulirwin / JaroWinklerStringSimilarity.sql
Last active October 3, 2026 03:14
Jaro-Winkler String Similarity in T-SQL
-- Based on code here: http://www.sqlservercentral.com/articles/Fuzzy+Match/65702/
-- Modified to be used in SQL Server Database Projects or run on its own, and fixed similarity vs distance confusion
CREATE FUNCTION [dbo].JaroWinklerGetCommonCharacters(@firstWord VARCHAR(MAX), @secondWord VARCHAR(MAX), @matchWindow INT)
RETURNS VARCHAR(MAX) AS
BEGIN
DECLARE @CommonChars VARCHAR(MAX)
DECLARE @copy VARCHAR(MAX)
DECLARE @char CHAR(1)
DECLARE @foundIT BIT