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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to get rows affected. 1

Status
Not open for further replies.

Gatorajc

MIS
Mar 1, 2002
423
US
Can any tell me how to write a query to get the rows affected below.

This is the query I wrote.

Select Date, Count (date) Total
From PRONOTES
group by date

which gives me this

Date Total
1900-01-01 00:00:00.000 1

and so on and so on

(148 row(s) affected)

how do I get it to just display the count for 148. I need it to create a dynamic array in ASP.





 
SELECT @@Rowcount

Will give you the number of rows affected by the previous statement.

It is probably better and safer to immediately store the rowcount in a separate variable.

DECLARE @rc INT

EXEC (@sql)
SET @rc = @@rowcount

RETURN @rc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top