How to Drop a Database from Visual Studio 2012

Posted on May 17, 2013. Filed under: Visual Studio | Tags: , , , |

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.


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).



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.


Connect to the master database of your database server.



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




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).


    Rowan works as a Program Manager for the ADO.NET Entity Framework team at Microsoft. He speaks at technical conferences and blogs at Rowan lives in Seattle, Washington with his wife Athalie. Prior to moving to the US he resided in the small state of Tasmania in Australia. Outside of technology Rowan's passions include snowboarding, mountain biking, horse riding, rock climbing and pretty much anything else that involves being active. The primary focus of his life, however, is to follow Jesus.


    Subscribe Via RSS

    • Subscribe with Bloglines
    • Add your feed to Newsburst from CNET
    • Subscribe in Google Reader
    • Add to My Yahoo!
    • Subscribe in NewsGator Online
    • The latest comments to all posts in RSS


Liked it here?
Why not try sites on the blogroll...

%d bloggers like this: