Passing Parameters into DTS Package

  • We have a .NET application and would like to know how to pass the parameters into the DTS package.  What is the command line to accomplish this?  your help is greatly appreciated.

  • What parameters are we talking about here?

    The answer will depend on what you are trying to achieve.


    ------------------------------
    The Users are always right - when I'm not wrong!

  • You can pass parameters on the DTSRun command line and the switches are best understood by using DTSRunUI to generate a command line for you.

    You also have the option of programatically instantiating a package and passing values to global variables as follows:

    'Bunch of declarations and other stuff....

    '*************************************************************************

    'Create an instance of a DTS object.

    '*************************************************************************

    Set oPackage = CreateObject("DTS.Package")

    '*************************************************************************

    'Connect to the DTS Package required. No Password needed.

    '*************************************************************************

    oPackage.LoadFromStorageFile  strCopyFile, ""

    '*************************************************************************

    'Verify you have a good reference

    '*************************************************************************

    If oPackage Is Nothing Or IsEmpty(oPackage) Then

        Exit Function

    End If

    '*************************************************************************

    'Update the Global Variables in the Loaded Package

    '*************************************************************************

    oPackage.GlobalVariables.Item("gstrUDLFile").Value =   DTSGlobalVariables("gstrUDLFile").Value

    oPackage.GlobalVariables.Item("gstrFactName").Value = "POS"

    oPackage.GlobalVariables.Item("gstrInputFile").Value = DTSGlobalVariables("gstrInputFile").Value

    '*************************************************************************

    'Execute the package.

    '*************************************************************************

    oPackage.Execute

    '*************************************************************************

    'Clean up references

    '*************************************************************************

    oPackage.UnInitialize

    Set oPackage = Nothing

    Enjoy!

    Trey Johnson | Chief Business Intelligence Architect | Cizer Software (www.cizer.com)

    Who? - Cizer - http://www.cizer.com/about.htm - Blog - http://www.sqlserverbi.com/
    What? - Products enhancing Microsoft Business Intelligence - http://www.cizer.com/products.htm
    Wow! - Empower your Developers.... NEW Drop In Reporting - http://www.cizer.com/cnr-drop-in-reporting.htm
    How? - BI Training - http://www.cizer.com/training.htm - Cizer Solutions - http://www.cizer.com/solutions.htm

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply