Check out the GET DIAGNOSTICS statement in SQL Reference Vol 2 manual. ROW_COUNT Identifies the number of rows associated with the previous SQL statement. If the previous SQL statement is a DELETE, INSERT, or UPDATE statement, ROW_COUNT identifies the number of rows that qualified for the operation.