Skip to content
Advertisement

Store result in Execute Sql task

I have written a stored procedure which will return the columns BEID, Date_of_txn, Txn_Amount as a result after the execution. I am getting the result manually when I run the stored procedure in SQL Server Management Studio. But I want to execute this stored procedure with “Execute SQL” task in SSIS and want to store the result in a variable. How can I do that?

I am not aware of how to store the result in result set as when I run the package, the package got failed every time.

  • Result set: Single Row
  • Connection Type: OLE DB
  • Connection: LocalHost.Fino_Detail
  • SQLStatement: Exec sp_HighAmount 02, 2019

Stored procedure:

Advertisement

Answer

There is a high probability that such query returns multiple rows, therefore a resul set should be switched to: “Full result set” and the output to be mapped to a variable with a type: Object, with a further foreach task to traverse of each row.

A good step-by-step walkthrough can read: Execute SQL Task in SSIS Full Row Set

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement