Mapping input parameters?

  • Hello,

    I've created a global variable that gets an id for any error processes that have been logged.  I have a SQL Exec task that I am running.  I need to check that global variable and see if there is a value.  If not then I process current day's data.  If the global variable is null, then I run a stored procedure to get a value.  I don't seem to be having any success with the following:

    declare @myID int

    Select @myID = global_variable

    if @myID is null then

      BEGIN

           exec @myID = exec spGETLatestID

      End

    select @myID

         

    How do I bring in a global variables?  I used the "?" placeholder and it didn't work:

    Set @myID = ?  --doesn't work and I get some error message.

    Any ideas on what I am doing wrong and how to bring in global variables as input variables?  I seem to have the output variables working fairly well.

    Tony

     

    Things will work out.  Get back up, change some parameters and recode.

  • I can't recall if I have heard this officially, but this is a bug!

    First, just type in your SQL just like you did.

    Then save the executesql task (if there are any warnings, ignore them).

    Next, open up Disconnected Edit (under the package menu).  Find the task that has your executesql.  Enter your parameter name in the InputGlobalVariableNames type each of your global variables.  I see in the one I just entered that the global variable with double quotes around it.  To put more than one, separate them with semicolon (.

    Russel Loski, MCSE Business Intelligence, Data Platform

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

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