How to Drop a Database from Visual Studio 2012

Seems like it should be easy right? It depends which SKU of Visual Studio you have…

 


Option 1: SQL Server Object Explorer

If you have a SKU of Visual Studio that includes SQL Server Object Explorer (SSOE) then it’s pretty easy. You’ve probably only got this if you parted with some hard earned cash to buy your copy of VS (or convinced your employer to do so Smile)

You’ll find SSOE under the View menu.

Menu

Once you have connected to your database server you can delete a database by right-clicking on it and selecting Delete (or selecting it and hitting the Del key).

Delete

 


Option 2: Write a Script

Sorry. This one will work with all SKUs of Visual Studio 2012.

You’ll need to open up Server Explorer.

ServerExplorer

Connect to the master database of your database server.

Connect

Master

Now write a script to drop the database and execute it (right-click –> Execute). The script syntax is very simple – DROP DATABASE <database name>

NewQuery

Script

 


Option 3: SQL Server Management Studio

If you don’t have SQL Server Object Explorer then I’d seriously consider just installing the Express version of SQL Server Management Studio. The installer is pretty horrible… but if you pass the intelligence test you will be rewarded with tools that make it very easy to drop databases (and many other useful tasks).