This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |