If I set a Microsoft SQL Server database to offline and drop it, it will be deleted, but the log and data files will remain. If I do it in online mode, there is a chance that another connection will stop me from dropping it. In a dev environment, or for a database that I want to periodically blow away and recreate on production, what's the best sequence of T-SQL commands to blow away a database, along with its data files and log files, that will work as long as I have sa privileges and no one is maliciously trying to stop me from dropping the database?
- Sql-server – Sql Server – Best Practices for Growing Database Files
- Sql-server – Full-text Catalog Corruption
- Sql-server – Distribution database (recovery pending)
- Sql-server – Should an OFFLINE database be SET EMERGENCY before dropping
- Sql-server – Piecemeal restore of entire database – fastest way to roll forward and restore multiple files
- Sql-server – Make a newer version of the LDF-file work with an older version of the MDF-file
- Sql-server – Recreate log file