Using String Functions to Search for Phonetically Similar Data : DIFFERENCE « String Functions « SQL Server / T-SQL Tutorial






Locating a customer name.
6>
7>
8> SELECT DIFFERENCE("Kathy Ward","kathy WARD"),
9>        DIFFERENCE("KATHY Ward","Cathy Ward"),
10>        DIFFERENCE("KATHY Ward","Cathie Ward")
11> GO

----------- ----------- -----------
          4           3           3

(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