Sunday, July 23, 2017

String function SOUNDEX

Soundex is how a name of a person is coded as used in the census for locating a person. It is based on how a name sounds rather than how it is spelled.

The name of the person is converted into a 4 character code, the first character in the code is the first letter of the person's name capitalized. The next three characters (they are number) that follow the rule stated here.

Rule 1:
For letters B,F,P,V                           use the number 1
For letters C,G,,K,Q,S,X,Z               use the number 2
For letters D,T                                  use the number 3
For letter L                                        use the number 4
For letters M and N                         use the number 5
For letter R                                        use the number 6

Rule2:
Disregard the letters A, E, I, O, U, H, W, Y (unless they are the first character in the name)

Example:
If the person's name is johnson, the first character in the soundex code is J

As to the rest of the characters in the code, using the above rules we have for johnson the Soundex code J525

The Soundex for Johnson is reduced to JNSN since O and H are not counted and N=5 and S=2 and J is the first character.

By the same rule, the Soundex code for Iowa is I000
Get more info from here:
http://www.archives.gov/research/census/soundex.html

and here:
http://www.ironrangeresearchcenter.org/genealogy/help/soundex/index.htm

Usage:



No comments:

Post a Comment

SQL Server 2025 ready to go

 I have not yet done looking at SQL Server 2022, SQL Server 2025 is ready to go. Microsoft is indeed relentless!  Microsoft announced SQL Se...