pencilCake
pencilCake

Reputation: 53223

How can I count the rows returned from a stored-procedure that returns a table?

Is it possible to count how many rows returned by a stored-procedure which returns a simple table?

Upvotes: 1

Views: 403

Answers (1)

gbn
gbn

Reputation: 432210

Return @@ROWCOUNT as either an output parameter or second result set.

Or add another column to the one resultset using a COUNT..OVER construct

...
COUNT(*) OVER () AS RowCount
...

Or read it in the client code eg DataTable.Rows.Count

Upvotes: 5

Related Questions