Re: Return value from Stored Procedure
- From: Light <a@xxxxx>
- Date: Fri, 06 Apr 2007 12:18:51 -0400
After playing with the code for awhile, especially with this
Set rsID = rsID.NextRecordset
I found out that on the Sql Server 2000, I need this line, and yet on the Express, I can do without it, what gives?
TIA
Bob Barrows [MVP] wrote:
1. When you execute a query in Query Analyzer, did you ever notice those "x rows affected" messages? Well, it's not just QA that those messages get delivered to. They get returned to ADO as recordsets ....
2. SQL Server does not return the output or return parameter values until all recordsets generated by the procedure are consumed
Setting NOCOUNT to off prevents those extra resultsets from being generated and returned.
Light wrote:
Hi Bob,
That does it, but why?
Thanks a billion, you just save my life:).
Bob Barrows [MVP] wrote:
Light wrote:
CREATE Procedure NewCompany
(
@varCompanyName varchar (50) = null,
@RETURN_VALUE int OUTPUT
)
As
You need to add "SET NOCOUNT ON" to this procedure - right here as a
matter of fact.
- Follow-Ups:
- Re: Return value from Stored Procedure
- From: Bob Barrows [MVP]
- Re: Return value from Stored Procedure
- References:
- Return value from Stored Procedure
- From: Light
- Re: Return value from Stored Procedure
- From: Bob Barrows [MVP]
- Re: Return value from Stored Procedure
- From: Light
- Re: Return value from Stored Procedure
- From: Bob Barrows [MVP]
- Return value from Stored Procedure
- Prev by Date: insert textbox entry into query
- Next by Date: Re: Return value from Stored Procedure
- Previous by thread: Re: Return value from Stored Procedure
- Next by thread: Re: Return value from Stored Procedure
- Index(es):
Relevant Pages
|
|