Copy the script in SQL Management Studio
The script will be helpful to kill all the user sessions before performing the refresh of the database.
There can be a great difference in the performance of a particular routine in a test database, and in a fully loaded production system. When you hit performance problems in a database under load, and there is excessive locking and blocking, how can you determine exactly where the problems lie, in order to fix them?
This article analyzes the performance gains of batching multiple DML statements into a single transaction. New author Manor Lev-Tov examines the effect of grouping statements together instead of running them all as separate transactions.