What is @@rowcount and with small code snippet explain the usage?
If you just search for it out first you will be able to find the answer. I recommend google.com.
@@RowCount returns the number of rows affected by the last statement.
Anyway, here are some simple snippets that could explain @@rowcount:
For example, if you have these records on a myTable:
ID - Name
-----------------------
1 - Apple
2 - Orange
3 - Grapes
- select * from myTable '@@rowcount = 3
-
select * from myTable where ID = 3 '@@rowcount = 1
-
update myTable set Name = 'Banana' where ID in (1,2) '@@rowcount = 2
-
set @variable = 'Hello' '@@rowcount = 1
To learn more,
click this .