Get number of rows affected

Is it possible when running an update/delete Query to grab the message xx row(s) Affected? when performing an exec statement?
LVL 4
Joachim CarreinSr. Software DeveloperAsked:
Who is Participating?
 
Patrick MatthewsConnect With a Mentor Commented:
After running an update/delete/insert statement, interrogate @@ROWCOUNT:

UPDATE
SELECT CONVERT(varchar(20), @@ROWCOUNT) + ' rows affected'
0
 
PedroCGDCommented:
after update add:
SELECT @@ROWCOUNT as RowsNumber
0
 
Joachim CarreinSr. Software DeveloperAuthor Commented:
stupid of me that i forgot this one...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.