Solved

Field Mappings in SSIS

Posted on 2009-07-01
5
397 Views
Last Modified: 2013-11-10
I've created a simple SSIS package loading data from our ERP system to our SQL tables. It has been requested of me that the 1 column (called DESC) from the source table be mapped to 2 columns (1 is called DESC and the other Shortname) in the destination table. Using the SSIS package, once I map a column from the source I cannot map that same column to another column in the source table. I'm guessing this is going to require a SQL statement? If so, what would the syntax be for that?

TABLE 1(SOURCE)              TABLE 2(DESTINATION)
DESC                                     DESC
                                              Shortname
Thank you in advance for your help.
0
Comment
Question by:jtlindner
5 Comments
 
LVL 39

Expert Comment

by:Kyle Abrahams
Comment Utility
How is shortname defined?
0
 

Author Comment

by:jtlindner
Comment Utility
oops forgot to add that. sorry about that.
shortname is nvarchar (50)
desc is nvarchar (254) (in both tables)
0
 
LVL 2

Accepted Solution

by:
Sguzek earned 250 total points
Comment Utility
You can use T-SQL syntax:

SELECT col1 as DESC, CAST(col1 AS NVARCHAR(20)) AS Shortname

or you can use CopyColumn transformation on Data Flow tab

Regards,
Slawek
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
I have no idea what you need, but that las SQL statement should have read:
SELECT col1 as [DESC], CAST(col1 AS NVARCHAR(20)) AS Shortname
0
 

Expert Comment

by:adeel289
Comment Utility
You should try to modify your SSIS package and see the example of Distributing the NAME Column into two Fields First Name and Last Name using SSIS package.
Hope this will help you,
http://vsteamsystemcentral.com/cs21/blogs/applied_business_intelligence/archive/2009/02/01/ssis-expression-language-and-the-derived-column-transformation.aspx
Thank you,
Adeel Shafqat
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now