How do you get return value from stored procedure?

How do you get return value from stored procedure?

Post by Reuben Pears » Sat, 12 Jan 2002 23:59:36



Hi there,

I am using an updategram to update multiple records from a web page.
XML data is returned to the browser and then rendered by binding a table to
the XML using datasrc="#XMLdata"
When clicking the update button I dynamically build the updategram string by
looping through the records using the RecordSet object. I then set the
"template" field on the form to the value of the string. So the updategram
might look like this:

<ROOT xmlns:updg="urn:schemas-microsoft-com:xml-updategram">
<updg:sync >
<updg:before>
   <tblCustomerForecast CustomerForecastID="96" />
</updg:before>
<updg:after>
   <tblCustomerForecast ForecastID="18" CustomerProductLineID="26" />
</updg:after>
<updg:before>
   <tblCustomerForecast CustomerForecastID="97" />
</updg:before>
<updg:after>
   <tblCustomerForecast ForecastID="18" CustomerProductLineID="27" />
</updg:after>
</updg:sync>
</ROOT>

I then submit this template to SQL Server and specify an XSL template called
jumpback.xsl (this does a window.history.back to return the user to the
submitting
page so that the updated results can viewed immediately).

How can I perform the same sort of update but calling a stored procedure for
each record that I want to update and how do I get the return value from a
stored procedure that I call using this method.

Thanks

Reuben

 
 
 

How do you get return value from stored procedure?

Post by Bryant Like » Sun, 13 Jan 2002 02:59:59



[snip]

Quote:> How can I perform the same sort of update but calling a stored procedure
for
> each record that I want to update and how do I get the return value from a
> stored procedure that I call using this method.

To execute a stored proc multiple times, you just call it multiple times:

<sql:query>

exec my_stored_proc 77, 18
exec my_stored_proc 78, 19

</sql:query>

If you want to capture the return code from a stored procedure take a look
at this example:
http://sqlxml.org/faq.asp?40

--
Bryant

 
 
 

1. problem getting return value from stored procedure

See:

http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q183001&

"SQL Server doesn't return output and return values until after the
recordset is populated; therefore, it would not be possible to
retrieve those values because the recordset is never being populated.
To solve the above issue, FlushResultSet() is used as depicted below."

Alternatively

http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q183297&

John

On Tue, 10 Sep 2002 11:13:20 -0700, "Patricio Burbano"

2. FileMakder FP3 File Format

3. Getting a Return Value from a SQL Stored Procedure in ASP

4. If Statement with 5 results from 15 variables?

5. Getting stored procedures return value.

6. aborting a script

7. Getting return values from stored procedure

8. Designer 2000 (or just Designer for those who are up to date)

9. Getting return value from stored procedure

10. Getting return values from stored procedures

11. Getting return value from stored procedure

12. Problems getting return value from stored procedure with new ODBC drivers

13. Getting the return value of a stored procedure using CRecordset