Calling a DTS package with parameters

  • I have had a HELL of a time trying pass parameters (global variables) into a DTS package via a cmd line. The syntax that i have found, both in db discussion forums and SQL BOL, seems pretty straight forward (see below), the syntax specifically for the global variable switches, is a little unclear unthough, eg,

    [/A global_variable_name:typeid=value].

    Im unclear on the ":type" portion of this switch. How should this be interpreted?

    1. /AvarName = "value"

    2. /AvarName:8="value"

    3. /AvarName = value (no quotes)

    Also, when creating the global variables in the DTS packages, should you leave the value field blank eg, <not displayable> or doesnt this matter, because the /A parms passed in will overide this?

    The actual cmd line syntax im using is as follows:

    DTSRUN /SserverName /NpkgName /E /ALocalFilePath ="UNCfilePath1" /ARemoteFilePath ="UNCfilePath2"

    My DTS package contains an activeX script, using VB that simply moves a file from a local dir to a remote (FTP) dir, using UNC paths, not drive letter paths. If using actual drive letter paths, i could of shelled out to dos and used "MOVE" to take care of this, but DOS doesnt seem to like UNC paths, thus i needed simple vb app (stand alone or in this case contained in a dts pkp) to perform the moving of a file.

  • The Typeid is an integer value that indicates the datatype of the global variable. This is needed because all the parameters that are passed to DTSRUN are passed as strings.

    I've always found it best to use DTSRUNUI to build the command lines. Settings for the global variables are available on the Advanced tab once you've selected a package. Then click "Generate..." and it's done. You can also encrypt the command as well.

    Hope this helps

    Phill Carter

    --------------------

    Colt 45 - the original point and click interface

    --------------------
    Colt 45 - the original point and click interface

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

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