Execute DTS Package with Global Variable Using dtsrun utility

  • Dear All,

    I have a DTS package named TruncateActualProduction with contains a Execute SQL Task which execute a stored procedure name TruncateData. This SP required an input parameter which supplied by a global variable name AcctPeriod ( type = string ).

    I would like to execute this procedure using dtsrun utility. I used the following command:

    dtsrun /Sgdinet /Usa /P /NTest /A"AcctPeriod:String=200401"

    The excution running smooth, but it seems the global variable that I pass through dtsrun never used in the execution. The DTS package does not have an owner password.

    On the first time, I think there is an error within the TruncateData SP, but I worked very well in Query Analyzer.

    What's wrong with my package??? Thanks in advance anyway

     

    Regards -- Hendra

     

     

     

  • Try replacing

    A"AcctPeriod:String=200401"

    with

    /A "AcctPeriod":"8"="200401"


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

  • Yes that would be the problem. You need to tell DTS the datatype of the parameter as well as the value.

     

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

  • Is the datatype of the parameter lists in BOL? If not, where I could find it? This would be a problem if there any more parameter with the different data type.

  • Yes. Lookup DTSRUN Utility in Books Online. There is a link about half way done that says "The table shows the global variable data types and their IDs."

    Click it and a table will expand showing the data types and their ID's.

     

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

  • Thanks Phil.

Viewing 6 posts - 1 through 5 (of 5 total)

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