Thursday, May 18, 2017

SOUNDEX Code to Evaluate Similarity in strings on SQL Server

   
     According to Wikipedia, Soundex is a phonetic algorithm for indexing names by sound.The goal is for homophones to be encoded to the same representation so that they can be matched despite minor differences in spelling. Sql Server has a function which gives us the Soundex code of any alphanumeric expression of character data.

SOUNDEX(string)

Soundex function returns a four character code. Please check here If you like learn more about how Soundex four character code is getting generated. Generating the code is the first step, we need to compare the soundex code to see how similar two items are. DIFFERENCE function lets us to compare Soundex codes in SQL Server. It compares two Soundex codes and returns an integer which represents how similar two codes are.

DIFFERENCE(soundexCode1, soundexCode2)

    Difference function returns an integer which is the number of characters in SOUNDEX code that are the same. Returned integer is between 1 and 4. 0 means there is no similarity between two codes, and 4 means same value or very strong similarity.


    I have created two Soundex code in this example, and I want to find the similarity between two.


  It returns 4 which means same or very strong similarity. Soundex is a great option to find similar data in your tables. You can generate the Soundex codes with computed columns in your tables and run a job later to find similar values/rows in your tables. It is very useful when you need to match and merge data in your database.

6 comments:

  1. We need many things check it by similarity tools. You talk about Soundex code somilarity checking. Thanks for share this. Please talk about text similarity checker.

    ReplyDelete
  2. wow you write some important point about SOUNDEX Code to Evaluate Similarity in strings on SQL Server . it will help the learner who just start learning SQL Server read more and it'll help you to know more about the academic papers writing.

    ReplyDelete
  3. very interesting and valueable blog, i am glad to know about soundex code, and auto grammar correct tools are wonderful, auto grammar correct thank you so much for sharing with this. keep posting.

    ReplyDelete
  4. If you're the beginner and you want to learn that how to make the front end of the website then you can get the idea from this helpful and learning zone. You can check it and use this link for a better purpose and also can find more tutorials for your help.

    ReplyDelete