PC Review


Reply
Thread Tools Rate Thread

Delete database

 
 
shapper
Guest
Posts: n/a
 
      27th Feb 2008
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
 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      27th Feb 2008
you can not drop a database in use. close all connections to the database,
then connect to master, then issue command.

-- bruce (sqlwork.com)


"shapper" wrote:

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

 
Reply With Quote
 
George Ter-Saakov
Guest
Posts: n/a
 
      27th Feb 2008
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.


"shapper" <(E-Mail Removed)> wrote in message
news:4561da23-f866-4bf8-a0d7-(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete a row in the database Tony Johansson Microsoft C# .NET 5 26th Aug 2008 02:57 AM
How can I delete database in the Open Recent Database list =?Utf-8?B?R2Vhcg==?= Microsoft Access 8 26th Jul 2006 06:43 AM
delete database name =?Utf-8?B?VA==?= Microsoft Outlook Discussion 1 21st Oct 2005 05:37 PM
How to delete a database? =?Utf-8?B?WXZvbm5lUA==?= Microsoft Access 14 7th Oct 2004 03:04 PM
Delete Component in Database Manager is always greyed out how - how do I delete a component Paul Cuthbert Windows XP Embedded 2 2nd Feb 2004 04:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:22 PM.