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.

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


Read Full Post | Make a Comment ( None so far )

Recently on RoMiller.com…

Running EF T4 Code Generation Templates from Command Line

Posted on May 15, 2013. Filed under: Entity Framework, Visual Studio | Tags: , , , , , |

EF6: Switching Identity On/Off with a Custom Migration Operation

Posted on April 30, 2013. Filed under: Entity Framework, Visual Studio | Tags: , , , , , |

Processor named ‘T4VSHost’ could not be found for the directive named ‘CleanupBehavior’

Posted on March 21, 2013. Filed under: Entity Framework, Visual Studio | Tags: , , , , , , |

EF6: Writing Your Own Code First Migration Operations

Posted on February 27, 2013. Filed under: Entity Framework, Visual Studio | Tags: , , , , , |

Extending And Customizing Code First Models – Part 2 of 2

Posted on February 15, 2013. Filed under: Entity Framework, Visual Studio | Tags: , , , , |

Extending and Customizing Code First Models – Part 1 of 2

Posted on February 5, 2013. Filed under: Entity Framework, Visual Studio | Tags: , , , , |

EF6 Code First: Configuring Unmapped Base Types

Posted on January 29, 2013. Filed under: Entity Framework, Visual Studio | Tags: , , , , |

EF6 Code First: Mapping All Private Properties Using Custom Conventions

Posted on January 23, 2013. Filed under: Entity Framework, Visual Studio | Tags: , , , , |

Code First Migrations – Customizing Scaffolded Code

Posted on November 30, 2012. Filed under: Entity Framework, Visual Studio | Tags: , , , , |

//build/ 2012 Talk Video and Source Code

Posted on November 20, 2012. Filed under: Entity Framework, Visual Studio | Tags: , , , , , |

Mapping to Private Properties with Code First

Posted on October 1, 2012. Filed under: Entity Framework, Visual Studio |

Code First Stored Procedures with Multiple Results

Posted on August 15, 2012. Filed under: Entity Framework | Tags: , , , |

Customizing ‘Reverse Engineer Code First’ in the EF Power Tools

Posted on May 9, 2012. Filed under: Entity Framework, Visual Studio | Tags: , , , , |

What tables are in my EF model? And my Database?

Posted on April 20, 2012. Filed under: Entity Framework, Visual Studio | Tags: , , , , , |

Dynamically Building a Model with Code First

Posted on March 26, 2012. Filed under: Entity Framework, Visual Studio | Tags: , , , , |

Testing With a Fake DbContext

Posted on February 14, 2012. Filed under: Entity Framework, Testing, Visual Studio | Tags: , , , , , , , |

Running & Scripting Migrations from Code

Posted on February 9, 2012. Filed under: Entity Framework, Visual Studio | Tags: , , , , |

Customizing Code First Migrations Provider

Posted on January 16, 2012. Filed under: Entity Framework, Visual Studio | Tags: , , , , |

Magic Free Code First Migrations

Posted on July 29, 2011. Filed under: Entity Framework, Visual Studio | Tags: , , , , |

    About

    Rowan works as a Program Manager for the ADO.NET Entity Framework team at Microsoft. He speaks at technical conferences and blogs at romiller.com. 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.

    RSS

    Subscribe Via RSS

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

    Meta

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

Follow

Get every new post delivered to your Inbox.

Join 86 other followers