Welcome to EMC Consulting Blogs Sign in | Join | Help

SSIS Junkie

SSIS: Building Packages Programatically

Many people require the ability to dynamically build packages at execution-time using the SSIS API. Typically this is because they have a large number of tables in the source that they want to transfer to the destination and they don't want to have to go through the rigmarole of building a data-flow for each one.

Kirk Haselden alluded to how you may do this in his blog post Self Modifying Packages in SSIS? although in that case he was trying to solve a slightly different problem Up until now I hadn't seen a working bit of code that demonstrates how to do this.

Until today that is. Jessica Elise has managed to achieve this and has posted her code here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1404157&SiteID=1&mode=1. If you are trying to build packages containing data-flows using the SSIS API then you do alot worse than copy what Jessica has done.

A few more references that you may find useful are:

Building Packages Programmatically
http://msdn2.microsoft.com/en-us/library/ms345167.aspx

Adding Tasks Programmatically 
http://msdn2.microsoft.com/en-us/library/ms135956.aspx

Adding Data Flow Components Programmatically
http://msdn2.microsoft.com/en-us/library/ms135932.aspx

Iterate over a package programatically
http://blogs.conchango.com/jamiethomson/archive/2007/03/06/SSIS_3A00_-Iterate-over-a-package-programatically.aspx

-Jamie

 

 

Published 28 March 2007 18:50 by jamie.thomson

Comments

 

Brandon said:

I am currently working on a project that will include code to dynamically generate SSIS packages from metadata.  I was looking at some of the MSDN links you have in this posting and just wanted to mention that these seem to be outdated.  I was not able to get any of the MS sample code to compile with my version of Visual Studio.  Once I downloaded the latest update for SQL Books Online, I was able to look up these articles on my machine and run the samples, which are quite different than the ones posted on the MSDN site.  Apparently, these libraries have gone through a few changes since they were originally written.  

Just wanted to give everyone a heads up in case you encounter this problem.  The new samples compile just fine and cover the same topics.

April 13, 2007 22:37
 

RobThames said:

any updates or lessons learned using this approach to change the detination?  I have it compiled but the custom task does not show up when I try to add it to the toolbar.  I have run the gacutil but it just does not seem to be there....anythoughts or advice for going down this path?

June 28, 2007 16:51
 

jamie.thomson said:

Rob,

Have you added it to :

%ProgramFiles%\Microsoft SQL Server\90\DTS\Tasks

?

-Jamie

June 28, 2007 17:10
 

RobThames said:

since it is a custom data flow I added it to the %Program Files%\Microsoft SQL Server\90\DTS\PipelineComponents.

June 28, 2007 17:18
 

RobThames said:

well I changed it to the tasks directory and it showed up.  However it does not appear to work.  I get the error....

The task user interface specified by type name 'DynamicDataTransfer.DynamicDataTransferTaskUI, DynamicDataTransfer, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=xxxxxxxxxxxxxxxx' could not be loaded. (Microsoft.DataTransformationServices.Design).

June 28, 2007 17:24
New Comments to this post are disabled

This Blog

Syndication

Powered by Community Server (Personal Edition), by Telligent Systems