Is there a way to track the execution count of a GO command in SQL Server.
I need to purge a large amount of data in very small batches from a very gigantic.
The best option I have found is to loop with GO and let it run overnight. I would like to know where I am at to report back on my peers how far I am at as it will hit the production database performance.
GO is the only method I have found that allows a swift cancelation without roll back.
/*
using a Variation of Fast Ordered Deletes
https://www.brentozar.com/archive/2018/04/how-to-delete-just-some-rows-from-a-really-big-table/
I delete from an Index view TOP 1000.
NOTE: a direct delete from the table takes ~30min.
*/
DELETE FROM v_DataToBePurged_FOD
GO 500000000
I need to run this command manually overnight to free up space and run GO for a very large amount of time.
Is there a undocumented way to see where I am at if I run it multiple time? https://learn.microsoft.com/en-us/sql/t-sql/language-elements/sql-server-utilities-statements-go