Without knowing exactly your need, i would start by returning a synapses of the events that transpired; kinda like what you thought with the
@@RowCount
One option would be to add in an a variable (eg
@TotalRows) and increment that after each statement
DECLARE @TotalRows INT = 0
SET @TotalRows = @TotalRows + @@RowCount
SET @TotalRows = @TotalRows + @@RowCount
SET @TotalRows = @TotalRows + @@RowCount
SET @TotalRows = @TotalRows + @@RowCount
SET @TotalRows = @TotalRows + @@RowCount
SET @TotalRows = @TotalRows + @@RowCount
SELECT TotalRows = @TotalRows
If you needed some more detail on the results instead of just the running sum, you could use a variable table to give a line-by-line resultset, and populate each step of the way
DECLARE @Results TABLE (ndx INT, TableName NVARCHAR(16), CRUD NCHAR(1), Rows INT)
INSERT @Results VALUES (1, 'Table1', 'C', @@RowCount)
INSERT @Results VALUES (2, 'Table2', 'C', @@RowCount)
INSERT @Results VALUES (3, 'Table3', 'U', @@RowCount)
INSERT @Results VALUES (4, 'Table4', 'U', @@RowCount)
INSERT @Results VALUES (5, 'Table5', 'D', @@RowCount)
INSERT @Results VALUES (6, 'Table6', 'D', @@RowCount)
SELECT * FROM @Results ORDER BY ndx
You could also go more advanced with the @Results version by using the OUTPUT clause to insert specific keys or other identifying information into the table
OUTPUT Clause (Transact-SQL) - SQL Server | Microsoft Docs[
^]