On development servers, at times there is a need for dropping and renaming database(s). These scripts can be used for achieving these tasks. The usp_DropDB script will kill the connections to the database and then drop the database. It takes care of the space in the database name, if any and also makes sure that […]
I got this script from SQL Server Professional Magazine in an article by Andrew Zanevsky. It performs transactions to fill up virtual log files and continually shrinks the log until the desired level of shrinkage is achieved.
This script will kill all users in a given database. Before disconnecting, it can optionally send the user a NET SEND Message giving them a warning to disconnect. To run, simply call it like usp_killusers 'dbname'. Make sure the @dbname parameter is not the master database.
When loading data, nothing can be more frustrating than having to deal with stubborn constraints and triggers. This is especially true when you know your data is fine but the constraints are too prohibitive for a mass initial load. Here's a technique I use to disable the constraints and triggers temporarily during a mass load. […]