Using Parameters in DTS

  • I would like to use parameters (a Begin Date and an End Date) in a DTS package.  So that when the package is run that it will prompt the user for the Begin Date and the End date but I don't know how to do this. 

  • You need to write activex task to bring up an input box. Here is the code:

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

    ' Visual Basic ActiveX Script

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

    Function Main()

    DTSGlobalVariables("gvName") = inputbox("put your prompt text in here")

    msgbox(DTSGlobalVariables("gvName").Value)

    Main = DTSTaskExecResult_Success

    End Function

    *****************************************************

    Make sure you create a global variable called gvName before you run it.


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

  • When you Create a Execute SQL Task -> RightClick on the ExecuteSQL Task -> Click on parameters-->SElect Output Parameter TAB and select Type.If Rows are defined in Select Statement in EXECUTE SQL Statement BOX, then select Type to "Row Value" and Defie ParametersName=(Name in Select Statement.i.e Select name,phone,add from emp... so name goes in parameters) and Give to corresponding Output variable name That you will use in the other Sters of the PAckage and you want to call elsewhere.

    You can Even define parameter on the Transformation STEPS.

    Check Booksonline for more info.

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

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