Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to capture No of Rows affected in case of Execute statement (CALL)

Status
Not open for further replies.

shuchis

Programmer
Dec 15, 2003
7
US
Hello,

I have one Stored procedure which executes multiple Stored proceudres in a loop. These sun procedures are stored in a table. So to execute them dynamically, i am using Prepare and execute command.

Now i also need to store the No of Rows affected/returned in case of each procedure. If the procedure is Update/Delete, i need to store the No of rows affected in some other table. if the procedure is of 'SELECT' type, i need to store all the records returned in 2nd table and Rows affected in other table.

I have tried using Get Diagnostics, but it seems, it works only in case of DML commands (Select, Update, Delete). When i try using this for 'Call <procedure'' it is returning 0.

Is there any way to find out these details for the Call Procedure statement. The thing is, when i simply write Call procedure in my sql client, in the output screen, i can see the no of rows affected, so there must be a way to find out that.

COuld you pleae help me with this

Many Thanks,
Shuchi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top