DIFFERENCE function returns a value between 0 and 4 that reflects how close a match there is between the two strings. : DIFFERENCE « String Functions « SQL Server / T-SQL Tutorial






A value of 0 means that the two strings aren't even close.
A value of 4 means a perfect match.


8> DECLARE @STRING_DIFFERENCE1 varchar(6)
9> DECLARE @STRING_DIFFERENCE2 varchar(6)
10> SET @STRING_DIFFERENCE1 = "Dewson"
11> SET @STRING_DIFFERENCE2 = "Joosun"
12> SELECT DIFFERENCE(@STRING_DIFFERENCE1,@STRING_DIFFERENCE2)
13> GO

-----------
          2

(1 rows affected)








12.4.DIFFERENCE
12.4.1.DIFFERENCE function returns a value between 0 and 4 that reflects how close a match there is between the two strings.
12.4.2.Using String Functions to Search for Phonetically Similar Data
12.4.3.DIFFERENCE() is a wrapper around two SOUNDEX().
12.4.4.SELECT DIFFERENCE ('Redmond', 'Renton')
12.4.5.Use SOUNDEX(au_lname) and DIFFERENCE
12.4.6.DIFFERENCE('Nite', 'Knight')
12.4.7.Use DIFFERENCE in where clause