Solved

Field Mappings in SSIS

Posted on 2009-07-01
5
400 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 40

Expert Comment

by:Kyle Abrahams
ID: 24757987
How is shortname defined?
0
 

Author Comment

by:jtlindner
ID: 24758289
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
ID: 24758688
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
ID: 24759537
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
ID: 24760728
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

863 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

28 Experts available now in Live!

Get 1:1 Help Now