Wednesday, March 7, 2012

Create N rows from 1 Row?

Hello...

I have a small question about how to realize something in SSIS.

We are rewriting an Application and we will be normalizing a table. The current Table has Data in the Format:

ID - Name - Type500 - Type1000 - Type2000

1 - Test - 2 - 1 - 0

2 - Test 2 - 0 - 2 - 1

The Targets would be:

ID - Name

1 - Test

2 - Test

TargetID , Type_ID , Date (+ ID Field omitted here)

1 - 1 - 1.1.1900

1 - 1 - 1.1.1900

1 - 2 - 1.1.1900

2 - 2 - 1.1.1900

2 - 2 - 1.1.1900

2 - 3 - 1.1.1900

So basically we need to generate N type rows for each "Count" in the Type Fields. So whats the best aproach to convert this data in an SSIS Package? Currently I am thinking about calling a SP to split the rows, but I dont "like" this aproach since it would place import/migration logic into the database and I would have to "clean up" later.

I can see two choices-

1 - Use a script component.

2 - Write a custom component.

For information, this would be an asynchronous component, as discussed in Books Online.

There is a similar problem covered here http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=511608&SiteID=1

|||

Thanks...

The link is exactly what I was looking for...

No comments:

Post a Comment