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
|