While executing a sql script in production like sensitive database, usually I do the followingBEGIN TRANSACTION--Declare of test variablesDECLARE @ExpectedAffectedRows INT = 10 -- Manually count thisDECLARE @ActualAffectedRows INT = 0-- Its a demo code, don't take it seriously ;PDELETE * FROM SomeTable AS st WHERE st.ColumnA = 'A'SET @ActualAffectedRows = @ActualAffectedRows + @@ROWCOUNTUPDATE SomeTableSET ColumnA = 'A' WHERE ColumnA='B'SET @ActualAffectedRows = @ActualAffectedRows + @@ROWCOUNTIF @@ERROR<>0 OR @ActualAffectedRows<>@ExpectedAffectedRows BEGIN     ROLLBACK     SET NOEXEC ON ENDIF @@TRANCOUNT>0  BEGIN     COMMIT ENDThe thing here, I hard coded the @ExpectedAffectedRows variable manually, counting how many rows will be affected. Is the process is fine? Or there are other superior process or best practice to deal with this type of data update/delete things ?
Executing test cases when executing the SQL script
sql;sql server