Similarity

Computes a similarity value of two strings in SQL Server

  • Free Function
  • SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017

Syntax:

SELECT SQLHTTP.net.HashString ( @Algorithm, @String1, @String2 )

Arguments:

Name Type Description
@Algorithm varchar(5) One of the following Algorithm: JW and DL (for Jaro-Winkler and Damerau-Levenshtein, respectively)
@String1 nvarchar(MAX) First string for which to compute similarity. These value are case sensitive even in case-insensitive SQL Server instances
@String2 nvarchar(MAX) Second string for which to compute similarity. These value are case sensitive even in case-insensitive SQL Server instances

Return Type:

numeric(27,7)

Sample Usage:

Jaro-Winkler:
Damerau-Levenshtein:

See Also: