Raja Afrika of the Afrika 8
Friday, March 29, 2024
 
Back to Raja's Blog

Raja's Blog
Not All Who Wander Are Lost

How to get a row count in a SQL Server Stored Procedure
Posted: Sunday, April 25, 2010

I don't know if I've ever used this function before. Thanks to BrettB of BrettB.com for this very helpful article.


The @@Rowcount function will be set after any statement that changes or returns rows. In the following statement, the RowsReturned column will display the number of rows selected by the previous select statement:


SELECT * FROM AUTHORS
WHERE state = 'CA'
SELECT @@rowcount AS 'RowsReturned'