Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Truncate if possible 1

Status
Not open for further replies.

Cpreston

MIS
Mar 4, 2015
972
GB
Not sure if anyone can advise on a SSIS package that I have that joins 2 CSV files together.

In The first one I have a Custid of 11003349270
In the second file I have Custid of 3349270

The second file will always be like this the last 7 digits of the first file custid.

In my SSIS I have them with 2 flat file sources, 2 sorts which then merge join and then creates a flat file destination. It is falling on the 2 custid codes being different. I have no other way to match the two files other than the custid,

Have you any idea how I can truncate the File1 CustID field to the last 7 digits in the SSIS package

Any ideas please. Thanks
 
Hi,

You can put the data into staging tables then in file one you can take the right 7 characters to match to file 2:
SQL:
Select right(columnName,7) from tableName

Thanks
Michael
 
Hi

Thanks, yes I used a derived column and used the right(columnName,7), all working now

 
Glad you got a solution.

Thank you for the star.

Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top