I am running sql server 2000. I have one database that I
cant delete. It says its in use when I try to delete it or
de-attach it. Its not in use by anyone but still wont let
me delete it. What am I missing?Hi,
Make sure that the database, indeed, is not in use by executing the below
command and check under 'dbname' column.
sp_who
--
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"JR" <anonymous@.discussions.microsoft.com> wrote in message
news:eba501c43cf6$07eadb70$a501280a@.phx.gbl...
> I am running sql server 2000. I have one database that I
> cant delete. It says its in use when I try to delete it or
> de-attach it. Its not in use by anyone but still wont let
> me delete it. What am I missing?|||Your own connection? If you are in Query Analyzer and you are in the
context of databaseA, you cannot drop databaseA. You need to switch to
master or some other database before dropping it, so that your context is
not preventing such activity.
If it is not your own connection, then use sp_who2 to determine which SPIDs
are connected to the database, who they belong to, and what they are doing.
If you can't determine who they are, or couldn't be bothered, you can set
the database to single_user and kick everyone out forcibly.
For detailed information please see http://www.aspfaq.com/2518
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"JR" <anonymous@.discussions.microsoft.com> wrote in message
news:eba501c43cf6$07eadb70$a501280a@.phx.gbl...
> I am running sql server 2000. I have one database that I
> cant delete. It says its in use when I try to delete it or
> de-attach it. Its not in use by anyone but still wont let
> me delete it. What am I missing?|||Hi,
Use the below script to drop the database.
use master
go
Alter database <dbname> set single_user with rollback immediate
go
drop database <dbname>
Thanks
Hari
MCDBA
"Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message
news:OyFGAfPPEHA.2444@.TK2MSFTNGP12.phx.gbl...
> Your own connection? If you are in Query Analyzer and you are in the
> context of databaseA, you cannot drop databaseA. You need to switch to
> master or some other database before dropping it, so that your context is
> not preventing such activity.
> If it is not your own connection, then use sp_who2 to determine which
SPIDs
> are connected to the database, who they belong to, and what they are
doing.
> If you can't determine who they are, or couldn't be bothered, you can set
> the database to single_user and kick everyone out forcibly.
> For detailed information please see http://www.aspfaq.com/2518
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "JR" <anonymous@.discussions.microsoft.com> wrote in message
> news:eba501c43cf6$07eadb70$a501280a@.phx.gbl...
> > I am running sql server 2000. I have one database that I
> > cant delete. It says its in use when I try to delete it or
> > de-attach it. Its not in use by anyone but still wont let
> > me delete it. What am I missing?
>|||Did you mean to reply to me?
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:umYwx4UPEHA.1160@.TK2MSFTNGP09.phx.gbl...
> Hi,|||No Aaron, its for the person (JR) who posted the question.
Thanks
Hari
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
news:usywR8VPEHA.308@.TK2MSFTNGP11.phx.gbl...
> Did you mean to reply to me?
>
> "Hari" <hari_prasad_k@.hotmail.com> wrote in message
> news:umYwx4UPEHA.1160@.TK2MSFTNGP09.phx.gbl...
> > Hi,
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment