Re: Return value from Stored Procedure
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Mon, 2 Apr 2007 19:30:36 -0400
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.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
.
- Follow-Ups:
- Re: Return value from Stored Procedure
- From: Light
- 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
- Return value from Stored Procedure
- Prev by Date: Re: Return value from Stored Procedure
- Next by Date: simple UPDATE not working
- Previous by thread: Re: Return value from Stored Procedure
- Next by thread: Re: Return value from Stored Procedure
- Index(es):
Relevant Pages
|