I\'m writing a script that will delete records from a number of tables, but before it deletes it must return a count for a user to confirm before committing.
This is
Never wait for an end user to commit the transaction, unless it's a single-user mode database.
In short, it's about blocking. Your transaction will take some exclusive locks on resources being updated, and will hold on to those lock untill the transaction is ended (committed or rolled back). Nobody will be able to touch those rows. There are some different problems if snapshot isolation is used with version store cleanup.
Better to first issue a select query to determine a number of qualifying rows, present this to the end user, and after he confirms do the actual delete.