title: How to get the last 4 digits of ssn
body: <p>Can someone, please, please help me here; I am very, very confused.</p>
  
  <p>I am grabbing ssn values from an oracle database with this query:</p>
  
  <pre><code>SELECT
  substr(SSN,6)
  FROM MYTABLE
  </code></pre>
  
  <p>and I am getting the correct value of the last 4 digits</p>
  
  <p>When I insert that value into a a sql server table, I am getting a different value.</p>
  
  <p>For instance, let's assume that the ssn that I am grabbing is 123456789, in Oracle, I get 6789 which is correct.</p>
  
  <p>However, after inserting the value into a sql server table as
  <code>Insert into mytable (ssn) values(ssn)</code>, the value shows as 5678.</p>
  
  <p>I also tried selecting the entire ssn as </p>
  
  <pre><code>SELECT
  substr(SSN)
  FROM MYTABLE
  </code></pre>
  
  <p>and then try inserting into a sql server db as:</p>
  
  <pre><code>Insert into mytable (ssn) values(right(ssn,4).
  </code></pre>
  
  <p>I still end up with 5678.</p>
  
  <p>Can anyone, please tell me what I am doing wrong?</p>
  
  <p>Thanks a lot in advance</p>