• First off I will say it was a nice article and offers so good alternatives. However I will point out two things.

    First, in part one there is a " missing in your build of the function right in front of Scripting.Dictionary in the line that reads

    sCode = sCode & "Set dictionary = CreateObject(" & chr(34)_

    & Scripting.Dictionary" & chr(34) & ")" & vbCRLF

    For Each sKey in aEntries.Keys()

    This is minimal but for those who cannot figure out why this isn't working it should read

    sCode = sCode & "Set dictionary = CreateObject(" & chr(34)_

    & "Scripting.Dictionary" & chr(34) & ")" & vbCRLF

    For Each sKey in aEntries.Keys()

    In addition I am not sure I would consider it helpfull to hide the parameters with this method as you really don't save a lot (and even on a large number of variables you have to resolve somehow the errors). Your statement that you can change variables also does not work as you will have to resolve any issues you get.

    Second, I completely disagree with part two, at least based on the example, as I think many people just have not figure out how to manage the things the parameter button cannot parse.

    I have worked with DTS for a while now and found this limitation a pain and then discovered via code and ultimately directly how to get around.

    For you example just insert the standard parameterized code into the ExcuteSQL task like so

    SELECT

    MAX(SALES_ORG) AS SALES_ORG,

    MAX(DISTR_CHANNEL) AS DISTR_CHANNEL,

    DATEADD( hh, ?, MIN( START_DT ) ) AS START_DATE,

    DATEADD( hh, ?, MIN( START_DT ) ) AS EFFECTIVE_START_DATE,

    PRODUCT_NAME AS PLI_PROD_NAME,

    MAX( RATE_ZPMC ) AS MAX_PRICE,

    VENDR_NAME,

    VENDR_LOC,

    VENDR_BU,

    DATEADD( hh, ?, MAX( END_DT ) ) AS END_DATE,

    DATEADD( hh, ?, MAX( END_DT ) ) AS EFFECTIVE_END_DATE

    FROM

    TMP_PRI_LST

    WHERE

    ROW_STATUS = 'FOR_IMPORT'

    AND ERROR_MSG IS NULL

    GROUP BY

    PRODUCT_NAME,

    VENDR_NAME,

    VENDR_LOC,

    VENDR_BU

    Now of course if you hit the "Parameters" button you get the error message

    "An error occurred while parsing the SQL Statement for parameters. Please ..."

    but this is only the parsing code for the button that fails.

    To get around this you just need open "Disconnected Edit" (right click on any whitespace of the design area or under Package menu). Once open then expand Tasks and pick the correct item with a name similar to "DTSTask_DTSExecuteSQLTask_" it will have the same description as what you just set if you bothered changing it. Anyway, there you will find an entry titled "InputGlobalVariableNames", edit this item and enter your variable input value like so

    "fix_utcdatetime"

    and since you have multiple values you have to enter it multiple times and in order like so

    "fix_utcdatetime";"fix_utcdatetime";"fix_utcdatetime";"fix_utcdatetime"

    The ; is the seperator and the variables are replaced in order. So if you had different values you place in orderinal fashion compared to the ? variable in our query. This works in every case, at least every case I ever tried, where you need it and the button wouldn't work.