Locked Calling a SSIS and Passing parameters to it

  • Tuesday, September 27, 2011 3:51 PM
     
     

    Hi All

    I have a SSIS package that just makes a folder (Child package) and i have a second package (parent) that calls the first package using a script task and the code is like .....

     

     

    Public SubMain()
     

     Dim fileName As String = "C:\Test\pkg_Child.dtsx"

     Dim XMLConfigfileName As String = "C:\Test\SSISxmlConfigFile.dtsConfig"  

    Dim app As NewApplication

    Dim pkg As Package = app.LoadPackage(fileName, Nothing)

    pkg.Execute()

    Dts.TaskResult = ScriptResults.Success

     End Sub

    My question is :

    I want to pass the XML file as a parameter ,what the XML file does is that it has Variable for a folder name, so that if i like to change the folder name (making new folder), I can change it in the XML file and the parent pakage will call the child pakage with the XML file as a parameter   


    Sincerely SH -- MCITP 2008, MCTS 2008 & 2005 -- Please kindly mark the post(s) that answered your question and/or vote for the post(s).

     

All Replies

  • Tuesday, September 27, 2011 8:43 PM
     
     Answered

    I found the answer my self

    to load multiple XML config file you can use

           Dim fileName As String = "C:\Test\pkg_Child.dtsx" '

           Dim XMLConfigfileName As String

           Dim app As New Application

           Dim pkg As Package = app.LoadPackage(fileName, Nothing)

     

    XMLConfigfileName = "C:\Test\xmlCnfgFile1.dtsConfig1"  ß File 1

    pkg.ImportConfigurationFile(XMLConfigfileName)

    XMLConfigfileName = "C:\Test\xmlCnfgFile1.dtsConfig2"  ß File 2

    pkg.ImportConfigurationFile(XMLConfigfileName)

    pkg.Execute()

     


    Sincerely SH -- MCITP 2008, MCTS 2008 & 2005 -- Please kindly mark the post(s) that answered your question and/or vote for the post(s).