[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 412
  • Last Modified:

Return parameters from a stored procedure are not coming back to SSIS properly

I am calling a Sql Server SP from an SSIS package. I am retunring two parameters from the SP. A return Code and a return description.
When I run the package it returns a couple errors.
I need to know what I am doing wrong when to get these errors.
I also noticed when I looked at the ssis variables that the return description is not being populated from the SP return parameters.

Any help would be appreciated. I fyou need more info please let me know.


Package Data Flow Fail Expression Sucess Expression General Tab Properties Parameter Tab Properties Call to the SP Errors received
0
gcrickman
Asked:
gcrickman
  • 5
  • 3
1 Solution
 
Anthony PerkinsCommented:
Try your SQL Query this way:
EXEC DELTEK.GT_STAGING_MAIN_PROC 0, 'NORMAL', 'N', ?, ?
0
 
gcrickmanAuthor Commented:
Thanks for your quick response. i don't believe that I need the print statement in this task.
Would you concur?
I will let you know how your suggestion goes.
0
 
gcrickmanAuthor Commented:
I am still receiving the same errors indicated above.
0
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 
Anthony PerkinsCommented:
Please post the contents of your SQL Query as it stands now.
0
 
gcrickmanAuthor Commented:
DECLARE @P_RETURN_CD VARCHAR(30), @P_RETURN_DESC  VARCHAR(200)
exec DELTEK.GT_STAGING_MAIN_PROC 0, 'NORMAL','N', ? , ?
go
0
 
Anthony PerkinsCommented:
Lose the DECLARE.  And it should just be like this:
exec DELTEK.GT_STAGING_MAIN_PROC 0, 'NORMAL','N', ? OUTPUT, ? OUTPUT

I am assuming you are using an OLEDB connection.
0
 
gcrickmanAuthor Commented:
I have removed the declare and set it up like you have listed.
What should I have for the result set be; none or single row?
I fI set to single I get this: [Execute SQL Task] Error: There is an invalid number of result bindings returned for the ResultSetType: "ResultSetType_SingleRow".
If I set to none I get this: [Execute SQL Task] Error: Executing the query "exec DELTEK.GT_STAGING_MAIN_PROC 0, 'NORMAL','N', ..." failed with the following error: "Parameter name is unrecognized.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

Do I have the Parameter Mapping tab setup correctly?
0
 
gcrickmanAuthor Commented:
I was able to finally get this to work by creating three input variables along with the two output parameters sending them to the SP call.
I used below link along with acperkins help and I was able to get it to work and return values coming back from the SP.

http://www.sqlis.com/post/The-Execute-SQL-Task.aspx
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now