Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 last 4 digits of ssn
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

327 Posts

Posted - 09/19/2011 :  15:51:03  Show Profile  Reply with Quote
Can someone, please, please help me here; I am very, very confused.

I am grabbing ssn values from an oracle database with this query:


and I am getting the correct value of 1111

When I insert that value into a a sql server table, I am getting a different value.

For instance, let's assume that the ssn that I am grabbing is 123456789, in Oracle, I get 6789 which is correct.

However, after inserting the value a sql server db as
Insert into mytable (ssn) values(ssn), the value shows as 5678.

I also tried selecting the entire ssn as

FROM MYTABLE and then try inserting into a sql server db as:

Insert into mytable (ssn) values(right(ssn,4).

I still end up with 5678.

Can anyone, please tell me what I am doing wrong?

Thanks a lot in advance

Constraint Violating Yak Guru

327 Posts

Posted - 09/19/2011 :  16:36:17  Show Profile  Reply with Quote
never mind, I got it.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000