0

I need to create an SSIS package to load data from a CSV, the tricky part is some of the columns need to be stored as rows. I better explain it with an example below.

From CSV file to Table in a different format as shown below

enter image description here

Is it possible with in SSIS or using SQL Server.

1 Answer 1

2

What you seek is called unpivot.

Please see this MSDN blog post for an example. To drop 0 values, you can use a conditional split, and push the 0 values to a garbage output.

http://blogs.msdn.com/b/dataaccesstechnologies/archive/2014/05/22/unvipot-transformation-with-a-combination-of-single-and-multiple-destination-columns.aspx

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the reply, this is 90% of what I want. However I also need the flat file columns to be inserted into table, from my above example Oct-15 which a column of flat file should go into the table. If it is going to be difficult I need to ask the sender to adhere to standard set of columns. I'll try unpivot today.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.