setting parameters in steps

  • In a DTS pkg, an Execute SQL task, I tried to use the question mark to set a global variable in a subquery and got a message along the lines that "...parameters cannot be set in subqueries..."

    Above the query I then tried the following

    declare @mydate datetime

    set @mydate = ?

    Then I got a message about a syntax error when I clicked the parameter button.

    Any suggestions on how I can get around these errors and set my paramter to the global variable defined in the package?

  • Try wrapping your query in your Execute SQL Task in a stored procedure and then pass in the parameter...this should work fine using the EXEC usp_mysproc ? syntax...

    hth,

    Michael

    Michael Weiss


    Michael Weiss

  • Great suggestion - worked wonderfully

    Thanks

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

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