Delete database

S

shapper

Hello,

I created a connection to my SQL Server in Visual Studio 2008. How can
I delete a database? I tried:

Drop database MyDb

It didn't work.

Thanks,
Miguel
 
B

bruce barker

you can not drop a database in use. close all connections to the database,
then connect to master, then issue command.

-- bruce (sqlwork.com)
 
G

George Ter-Saakov

1. To use DROP DATABASE, the database context of the connection must be in
the master database
2. You cannot drop a database currently in use (open for reading or writing
by any user).

George.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top