Tuesday, March 20, 2012

cannot delete database

Hello:
I am trying to delete a database from Enterprise Manager 2000 SP4. I am
right-clicking on the database and choosing delete.
But, SQL does not delete the database. It freezes up, in fact.
How can I delete this database? Actually, there are about 15 in total that
I need to delete. This one that I cannot delete is the first of those 15.
I
imagine that I will have this same problem with the others.
Thanks!
childofthe1980s"childofthe1980s" <childofthe1980s@.discussions.microsoft.com> wrote in
message news:9DE05088-641D-42B4-AC3B-2687C3F7D7AA@.microsoft.com...
> Hello:
> I am trying to delete a database from Enterprise Manager 2000 SP4. I am
> right-clicking on the database and choosing delete.
> But, SQL does not delete the database. It freezes up, in fact.
> How can I delete this database? Actually, there are about 15 in total
> that
> I need to delete. This one that I cannot delete is the first of those 15.
> I
> imagine that I will have this same problem with the others.
> Thanks!
> childofthe1980s
Don't use the GUI.
Use Query Analyzer and use DROP DATABASE 'foo'.
It should return with either the database dropped or a message that it is in
use.
use SP_who to find out who is using it and disconnect the clients or KILL
the spids.
Greg Moore
SQL Server DBA Consulting
Email: sql (at) greenms.com http://www.greenms.com|||Rather than writing a cursor for killing the processes, I would use the
ALTER DATABASE command setting the user Mode to SINGLE_USER (or using the
administrative mode, otherwise the users or the applications will login
again) and use the ROLLBACK IMMEDIATE switch to change the status of the
database immediately. Be aware that current transactions are rolled back
then. If you want to have another behaviour, you should use another switch
instead (see the BOL for more information about that). AFterwards use the
DROP DATABASE command to wipe out the database.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
--
"Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in message
news:%23J%23tFYDZHHA.1240@.TK2MSFTNGP04.phx.gbl...
> "childofthe1980s" <childofthe1980s@.discussions.microsoft.com> wrote in
> message news:9DE05088-641D-42B4-AC3B-2687C3F7D7AA@.microsoft.com...
>
> Don't use the GUI.
> Use Query Analyzer and use DROP DATABASE 'foo'.
> It should return with either the database dropped or a message that it is
> in use.
> use SP_who to find out who is using it and disconnect the clients or KILL
> the spids.
>
>
> --
> Greg Moore
> SQL Server DBA Consulting
> Email: sql (at) greenms.com http://www.greenms.com
>|||Hello,
While you drop a database using enterprise manager, it deletes all the
Backup and Restore history informations from MSDB database. This
will take a long time being this deleted inside a cursor. So it would be
better to drop the databse using the TSQL command
DROP DATABASE <DBNAME>
Thanks
Hari
"childofthe1980s" <childofthe1980s@.discussions.microsoft.com> wrote in
message news:9DE05088-641D-42B4-AC3B-2687C3F7D7AA@.microsoft.com...
> Hello:
> I am trying to delete a database from Enterprise Manager 2000 SP4. I am
> right-clicking on the database and choosing delete.
> But, SQL does not delete the database. It freezes up, in fact.
> How can I delete this database? Actually, there are about 15 in total
> that
> I need to delete. This one that I cannot delete is the first of those 15.
> I
> imagine that I will have this same problem with the others.
> Thanks!
> childofthe1980s

No comments:

Post a Comment