Re: SP - output parameter not coming back
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Wed, 15 Jun 2005 09:35:34 -0400
Axel wrote:
> Just one more info = just managed to test with SQL Query Analyzer, I
> changed the test script to include output and I can now verify that
> the SP is working correctly, filling in the output parameter; this
> means the problem is reading it back. Am I missing a step between
>
> Set rs = CmdSP.Execute( ) ' RecordCount can not be used
>
> and
>
> lRecCount = CmdSP.Parameters("@mycount").Value
Yes, you're failing to retrieve the entire resultset, either by moving to
the last record or by closing the recordset. SQL Server will not send the
output parameter value UNTIL all the resultsets generated by your stored
procedure have been sent (if your procedure returns multiple resultsets, for
example, if you don't SET NOCOUNT OFF - you will need to use NextRecordset
to cycle through the resultsets until you've retrieved the last one. Only
then will SQL Server send the output parameter value)
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
.
- Follow-Ups:
- Re: SP - output parameter not coming back
- From: Axel
- Re: SP - output parameter not coming back
- References:
- Re: SP - output parameter not coming back
- From: Bob Barrows [MVP]
- Re: SP - output parameter not coming back
- From: Axel
- Re: SP - output parameter not coming back
- From: Axel
- Re: SP - output parameter not coming back
- Prev by Date: Re: SP - output parameter not coming back
- Next by Date: Re: Error Creating ADODB.Connection Connection in IIS6
- Previous by thread: Re: SP - output parameter not coming back
- Next by thread: Re: SP - output parameter not coming back
- Index(es):
Relevant Pages
|