t-sqlstored-proceduresasp-classicrowset

Classic ASP - how to get all T-SQL stored procedure rowsets


I have simple SQL stored procedure with several SELECT statements in it and want to extract this information like this:

Set cmd = Server.CreateObject("ADODB.command")
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "MyStoreProcedure"
cmd.ActiveConnection = objConnection
cmd.NamedParameters = True

cmd.Parameters.Append ...
cmd.Parameters.Append ...

Set rs = cmd.Execute()

How can I iterated over the rowsets in classic asp?


Solution

  • You need use NextRecordset method, see description here http://msdn.microsoft.com/en-us/library/windows/desktop/ms677539(v=vs.85).aspx