• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MS SQL Stored proc returns multiple recordsets

I have a stored proc on a MS SQL server, that returns 3 recordsets.

How can i differentiate between each record set? (i want 1 field from the first recordset, and all of the second recordset).

Any ideas?

You probably call mssql_next_result(). But I doubt this is possible using CI's ActiveRecord.

i will give it a go.


You might wanna anaylze the adodb php library for how they accomplish this too:


Good luck

CI won't allow that call - mssql_next_result($query).

I will now suss out the adodb.

Thanks heaps for your help. If i find anything useful, i will be sure to post back here.

thanks again

Isn't that a bit drastic?

Nobody's stopping you from calling this function outside of CI's AR system, or to add the method to CI's AR library. That seems to me a lot easier than switching to adodb...

What is the AR system that you are talking about?

Is the mssql drivers php files, or is it something else?


sorry, AR = active record.

i have been using the below:
do {
        echo $this->result_id ."<br>";
        while ($row = mssql_fetch_row($this->result_id)) {
            echo "$row[0] -- $row[1]<BR>";
        } while (mssql_next_result($this->result_id));

i am attempting to play around with it, and i am getting some results.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.