Sound difference : SOUNDEX « String Functions « SQL Server / T-SQL Tutorial






4> DECLARE @Word1 VarChar(100)
5> DECLARE @Word2 VarChar(100)
6> DECLARE @Value1 Int
7> DECLARE @Value2 Int
8> DECLARE @SoundexDiff Int
9> SET @Word1 = 'Redmond'
10> SET @Word2 = 'Renton'
11> SELECT @Value1 = CONVERT(Int, SUBSTRING(SOUNDEX(@Word1), 2, 3))
12> SELECT @Value2 = CONVERT(Int, SUBSTRING(SOUNDEX(@Word2), 2, 3))
13> SET @SoundexDiff = ABS(@Value1 - @Value2)
14> PRINT @SoundexDiff
15> GO
180








12.18.SOUNDEX
12.18.1.SOUNDEX checks how similarly sounding two tested strings can be.
12.18.2.Sound difference
12.18.3.SOUNDEX('Knight')
12.18.4.Determining the Similarity of Strings