locked
Shared Scripts between SSIS Packages RRS feed

  • Question

  • I created a script to parse special characters out of a file that I have.

    I used a script task in my ssis project to do this.

    Now what I would like to do is to use the same script to parse multiple files.  I am wondering if there is some way to have a global script that can be called from multiple packages.

    So for example each file has different # of columns to parse:

    I'd like to pass the column number to the function as a variable within the package.

    example: Call parsefiles(numcols as integer)

    It seems that each package has its own code so I have to copy the code for each package.  Is there some way to have one module shared by multiple packages?  I have studio 2010 and 2012 if that matters.

    Monday, December 21, 2015 8:09 PM

Answers

  • Hi dbigelbach,

    Perhaps you should make it part of a child package you can run from a parent package. This way you pass in only the needed parameters (e.g. a Project wide one) and never copy paste the same code.


    Arthur

    MyBlog


    Twitter

    Monday, December 21, 2015 8:29 PM
  • Hi dbigelbach,

    Based on your description, you want to share some components from other package to your current package.

    In SQL Server Integration Services, it doesn’t support share components for packages directly. To work around this issue, we can use a package to contain those components which need to be shared. Then use Execute Package Task to run that package as child package. For more details about Execute Package Task, please see:
    https://msdn.microsoft.com/en-us/library/ms137609%28v=sql.110%29.aspx?f=255&MSPPError=-2147217396

    Thanks,
    Katherine Xiong


    Katherine Xiong
    TechNet Community Support

    Wednesday, December 23, 2015 8:34 AM

All replies

  • Hi dbigelbach,

    Perhaps you should make it part of a child package you can run from a parent package. This way you pass in only the needed parameters (e.g. a Project wide one) and never copy paste the same code.


    Arthur

    MyBlog


    Twitter

    Monday, December 21, 2015 8:29 PM
  • Hi dbigelbach,

    Based on your description, you want to share some components from other package to your current package.

    In SQL Server Integration Services, it doesn’t support share components for packages directly. To work around this issue, we can use a package to contain those components which need to be shared. Then use Execute Package Task to run that package as child package. For more details about Execute Package Task, please see:
    https://msdn.microsoft.com/en-us/library/ms137609%28v=sql.110%29.aspx?f=255&MSPPError=-2147217396

    Thanks,
    Katherine Xiong


    Katherine Xiong
    TechNet Community Support

    Wednesday, December 23, 2015 8:34 AM
  • I would recommend you check the commercial COZYROC Script Task Plus. It is an extension of the standard Script Task with support for script sharing for use in multiple packages.

    SSIS Tasks Components Scripts Services | http://wwww.cozyroc.com/

    Thursday, December 24, 2015 7:39 PM