Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 MSSQL 2k SP1 - Stored Procedures result problem

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-07-22 : 07:36:01
Sven writes "Hi,

I've been discussing on the aspmessageboard.com in the Advanced board regarding the result set from a procedure.

I'm passing the results back to a VBScript on an ASP page. I know you don't deal with asp - just SQL... but the guy called "Dutch" recommended I come and ask you.

I am trying to return the results *including* the part that are used when I use the 'Print' command.

Unfortunately it is only returning the parts from the "Select" statements. Is there ANY way at all I can either:

1. Return the full result set from the SP, including the 'Print' statements
2. Step through the result sets, and then deal with the results from a 'Print' statement separately?

Thanks for your time,

Sven."

smccreadie
Aged Yak Warrior

505 Posts

Posted - 2003-07-24 : 22:00:13
There is a way in classic ASP to handle multiple recordsets. I believe the syntax was rs.next. You might want to do a google search on multiple recordsets in asp.

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-07-24 : 22:06:37
RS.NextRecordset

However, this won't include Print statements...which you shouldn't be using in production code anyway. An ADO Recordset object will never see Print statement messages. Either convert them to SELECT statements, or use RAISERROR to raise messages. A low severity level will not terminate the commands. Books Online has more information on RAISERROR.

You can also return messages with OUTPUT variables, but you must use stored procedures and ADO Command objects, which is an excellent practice too if you're not already doing it.

You can find out more in this article:

http://www.sqlteam.com/item.asp?ItemID=2644

Go to Top of Page
   

- Advertisement -