Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS Output Parameter error


SSIS Output Parameter error

Author
Message
mark.wilson 2925
mark.wilson 2925
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 31
Hi all,
I am attempting to run a stored procedure with a single output parameter and then map it to a variable. Seems simple in theory, but I keep getting the error
"There is an invalid number of result bindings returned for the ResultSetType"

After looking at all the answers i can find, none seem to answer my problem.

the SP:-

Create Procedure ReturnsessionVariables(@sessionid INT,@groupshare varchar(2000),@returnvalue nvarchar(max) output)
as
begin
   DECLARE @guid NVARCHAR(8)

   SELECT @guid = guid from THANDLERSESSION where sessionid = @sessionid

select @returnvalue = substring((SELECT ','+keyname+'='+case when CHARINDEX(@guid,keyvalue) != 0 and keyvalue != @guid then @groupshare + right(keyvalue,len(keyvalue)-CHARINDEX(@guid,keyvalue)) else keyvalue end
from THANDLERPARAMS HP
where sessionid = @sessionid
FOR XML PATH ('')),2,2500)

end

Basically i am reading all the parameters from a table and creating a concatenated string that can then be passed to the next step in my package.
Output Example :-
hrfile=tvdev2.xlsx,skipexceptions=0,appenddata=-1,emailpassword=-1

this proc works fine and returns the data when I run it in SQL.

In SSIS i am attempting to run the proc and return the value to a variable.




As far as i can see I am doing everything ok, but i cannot work out what I must be doing wrong. This is a single return value proc so no issue with more than 1 row, object assignment etc. So what i am doing wrong?

Thanks
Attachments
ExecuteSQL Screen.png (32 views, 20.00 KB)
Parameters.png (32 views, 19.00 KB)
Phil Parkin
Phil Parkin
SSCrazy Eights
SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)

Group: General Forum Members
Points: 8312 Visits: 19457
Try putting

SET NOCOUNT ON

at the top of your proc.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
mark.wilson 2925
mark.wilson 2925
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 31
Hi,
Thanks for the suggestion
Unfortunately, it has made no difference. Still the same error getting returned in SSIS when I try to run it.
mark.wilson 2925
mark.wilson 2925
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 31
It's amazing what randomly changing things does.

It seems that because I had a result set as singleRow it was expecting a dataset to come back , and it does not interprete an output value from a Stored Proc as a dataset.

By simply changing the resultset value to "None", the issue has gone away and my value is being returned fine.

Cheers
Phil Parkin
Phil Parkin
SSCrazy Eights
SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)

Group: General Forum Members
Points: 8312 Visits: 19457
Do you have anything on the resultset tab?

Edit - well done on solving it.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search