SOUNDEX function [String]

Returns a number representing the sound of a string.

Syntax
SOUNDEX( string-expression )
Parameters
  • string-expression   The string to be evaluated.

Returns

SMALLINT

Remarks

The SOUNDEX function value for a string is based on the first letter and the next three consonants other than H, Y, and W. Vowels in string-expression are ignored unless they are the first letter of the string. Doubled letters are counted as one letter. For example, the word apples is based on the letters A, P, L, and S.

Multibyte characters are ignored by the SOUNDEX function.

Although it is not perfect, the SOUNDEX function normally returns the same number for words that sound similar and that start with the same letter.

The SOUNDEX function works best with English words. It is less useful for other languages.

See also
Standards and compatibility
  • SQL/2003   Vendor extension.

Example

The following statement returns two identical numbers, 3827, representing the sound of each name.

SELECT SOUNDEX( 'Smith' ), SOUNDEX( 'Smythe' );