title: How does the Soundex function work in SQL Server?
body: <p>Here's an example of Soundex code in SQL:</p>
  
  
  
  <pre><code>SELECT SOUNDEX('Smith'), SOUNDEX('Smythe');
  ----- ----- 
  S530  S530  
  </code></pre>
  
  <p>How does <code>'Smith'</code> become <code>S530</code>?</p>
  
  <p>In this example, the first digit is <code>S</code> because that's the first character in the input expression, but how are the remaining three digits are calculated?</p>