DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Joe Enos
Joe Enos

Posted on

Drop SQL Server Database

Sometimes in SQL Server you need to quickly drop and recreate a database, especially early in development. Unfortunately, it's not so easy to drop a database when it's in use, which it might be while you're debugging.

To get around that, you can set the database to single user mode, then immediately drop it and recreate it. You can even do this in the middle of debugging, so you don't have to restart your application.

Here's how to do it:

Top comments (0)

🌱 DEV runs on 100% open source code known as Forem.

Β 
Contribute to the codebase or learn how to host your own.