I am trying to drop a database

I am trying to drop a database

Post by WAPsturbate.co » Sun, 29 Oct 2000 09:15:42



Hi,

I am trying to drop a database using query analyzer.

I do:

DROP DATABASE countries

and I get the following error:

"Cannot drop the database 'countries' because it is currently in use."

I am not using that database, or at least I am not aware of it being used.
Can you tell me what I should do.

My idea would be to stop the SQL7.0 server and try to delete again, then
start the server.
I have no access to Enterprise Manager, since I do it remotely. I can only
use query analyzer.

Can anybody help?

Thank you.

 
 
 

I am trying to drop a database

Post by Carlos Eduardo Roja » Sun, 29 Oct 2000 09:51:06


Check with sp_who2 who is connected to the database, and then using the spid
supplied by sp_who2, kill the connection using the KILL command.
--
------------------------------------------------
Carlos Eduardo Rojas
MCSE + Internet, MCDBA, MCSS
PASS Spanish Group

Quote:> Hi,

> I am trying to drop a database using query analyzer.

> I do:

> DROP DATABASE countries

> and I get the following error:

> "Cannot drop the database 'countries' because it is currently in use."

> I am not using that database, or at least I am not aware of it being used.
> Can you tell me what I should do.

> My idea would be to stop the SQL7.0 server and try to delete again, then
> start the server.
> I have no access to Enterprise Manager, since I do it remotely. I can only
> use query analyzer.

> Can anybody help?

> Thank you.


 
 
 

I am trying to drop a database

Post by Kalen Delane » Sat, 04 Nov 2000 04:00:00


If you run the sp_who stored procedure, it will show you all the current
connnections to your SQL Server, and what database they are currently using.
Maybe that will give you a clue.

You can't drop the database BEFORE you restart the SQL Server; if you are
able to stop the server, you must restart it before trying to drop a db.

You can STOP the SQL Server service from any connection with the SHUTDOWN
command (doc'd in BOL) if you have 'sa' privileges. Of course, someone else
will have to restart the SQL Server.

HTH

--
Kalen Delaney
MCSE, SQL Server MCT, MVP
www.InsideSQLServer.com
Feed Someone for Free Today:
     www.TheHungerSite.com


Quote:-----Original Message-----

Hi,

I am trying to drop a database using query analyzer.

I do:

DROP DATABASE countries

and I get the following error:

"Cannot drop the database 'countries' because it is currently in use."

I am not using that database, or at least I am not aware of it being used.
Can you tell me what I should do.

My idea would be to stop the SQL7.0 server and try to delete again, then
start the server.
I have no access to Enterprise Manager, since I do it remotely. I can only
use query analyzer.

Can anybody help?

Thank you.

.

You may be in the database you are trying to drop.
type use master
then drop the database.

Hope that helps :)

 
 
 

I am trying to drop a database

Post by Sean » Sat, 04 Nov 2000 22:14:26


Quote:-----Original Message-----

Hi,

I am trying to drop a database using query analyzer.

I do:

DROP DATABASE countries

and I get the following error:

"Cannot drop the database 'countries' because it is currently in use."

I am not using that database, or at least I am not aware of it being used.
Can you tell me what I should do.

My idea would be to stop the SQL7.0 server and try to delete again, then
start the server.
I have no access to Enterprise Manager, since I do it remotely. I can only
use query analyzer.

Can anybody help?

Thank you.

.

You may be in the database you are trying to drop.
type use master
then drop the database.

Hope that helps :)

 
 
 

I am trying to drop a database

Post by Rav » Tue, 21 Nov 2000 04:00:00


That would be the way to go: execute sp_who2 should give you an account as
to who is currently using the database.

If noone is using it, you should be able to drop the database.

Hope this helps!

 
 
 

1. I am trying to drop a database

Hi,

I am trying to drop a database using query analyzer.

I do:

DROP DATABASE countries

and I get the following error:

"Cannot drop the database 'countries' because it is currently in use."

I am not using that database, or at least I am not aware of it being used.
Can you tell me what I should do.

My idea would be to stop the SQL7.0 server and try to delete again, then
start the server.
I have no access to Enterprise Manager, since I do it remotely. I can only
use query analyzer.

Can anybody help?

Thank you.

2. Need help with Foxprow 2.6.

3. Problem with sp_sproc_columns getting Return_value as output parameter

4. testing when recordset filled

5. An appropriate lock

6. Problem: I am trying to insert a query into a table

7. I am trying to store the result of a dynamic sql query in a variable

8. Enterprize Manager locks up when i am trying to make changes to a table

9. Newbie Question: I am trying to Change the sourcefile name of an ftp task

10. I am trying to locate the T-SQL debugger which comes with Query Analyzer