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.
| Author |
Topic |
|
orozcoc
Starting Member
13 Posts |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-09-20 : 11:46:51
|
| After you execute the procedure, the @@ROWCOUNT variable will return the number of rows that it generated (just like any other SQL statement) |
 |
|
|
orozcoc
Starting Member
13 Posts |
Posted - 2002-09-20 : 11:55:56
|
| But if I run the Select it will return the table, now I'm running a cursor on the result table to return a paginated subset of the result to the browser, and to calculate the total pages I still need the total number of rows returned.Thanks for all your help |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2002-09-20 : 12:31:49
|
| when a SP returns a recordset to you, you get a couple of 'freebies' with it....an error code if any (@@ERROR)...and a RECORDCOUNT (@@ROWCOUNT)....you don't have to issue any command to request them...the system calculates them for you....SELECT * FROM CUSTOMER(on a table with 10 customer)will give you a recordset of 10 records AND fill the variable @@ROWCOUNT with 10...try the statements below....SELECT @@ROWCOUNTSELECT * FROM CUSTOMERSELECT @@ROWCOUNTyou will see that the @ROWCOUNT variable changes from 1 to 10 solely because of the SELECT * statement between them.if you are calling the SP from VB....the recordset (depending on the mode (forwardonly)??? of calling the SP) will have a property of ".recordcount"...which will hold the @@ROWCOUNT value.... |
 |
|
|
|
|
|