Need sol for storing sp return value into a variable

Answered Need sol for storing sp return value into a variable

  • Saturday, June 02, 2012 12:28 PM
     
     

    Hiiiii,

      My  package has 3 variables(Src ,Dest and ReturnValue )declared at  package level and all are Int32 data type Type. 

     My sp contains One input parameter and one output parameter. It(sp) is returning a result set and a returnvalue.When i  am executing the sp using Execute Sql Task, I am able to capturing the return value into a variable(i.e.ReturnValue). The following is my query:

    exec ?= dbo.Promotion_TransactionExtract_j6 ?,? OUT

    and Parameter Mapping

    Parameter mapping

    But i am unable to capturing the return value,  when i execute the sp in oledb source under Data Access Mode is SQL Command. I used the following Query:

    exec  dbo.Promotion_TransactionExtract_j6 ?,? OUT

    and Parameter Mapping

    Parameter Mapping in Oledb source

    @LAST_EXECUTED_ID_IN is my input parameter and @LAST_EXECUTED_ID_OUT is my output parameter.

    If i use the following query it is giving error:

    exec ?= dbo.Promotion_TransactionExtract_j6 ?,? OUT

    Error:

    [OLE DB Source [1]] Error: The SQL command requires a parameter named "@RETURN_VALUE", which is not found in the parameter mapping.

    [SSIS.Pipeline] Error: component "OLE DB Source" (1) failed the pre-execute phase and returned error code 0xC0207014.

    But i have only one input parameter and one output parameter so that 

     how can i capture sp return value in this scenario?

    can anyone help on dis?

    Thanks,

    Visu

All Replies