Delete database

  • Thread starter Thread starter shapper
  • Start date Start date
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
 
you can not drop a database in use. close all connections to the database,
then connect to master, then issue command.

-- bruce (sqlwork.com)
 
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.
 
Back
Top