• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 913
  • Last Modified:

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?
0
Joachim Carrein
Asked:
Joachim Carrein
1 Solution
 
Patrick MatthewsCommented:
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

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now