Re: Programmatically Dropping databases
From: KB (a_at_b.com)
Date: 12/06/04
- Next message: Alejandro Mesa: "RE: Programmatically Dropping databases"
- Previous message: David Browne: "Re: Simulate auto increment fields"
- In reply to: Jon Pope: "Programmatically Dropping databases"
- Next in thread: Alejandro Mesa: "RE: Programmatically Dropping databases"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 6 Dec 2004 14:19:56 -0500
you have to kill all user processes that are currently connected to your db
use sp_who to list all the connections and use the KILL command with SPID
from sp_who as a parameter to kick them out
"Jon Pope" <jon.pope@healthlinkinc.com> wrote in message
news:O5b%23XY82EHA.3380@TK2MSFTNGP09.phx.gbl...
> I'm trying to drop a SQL2K database through SQL. I'm using the following
> command:
>
> USE Master DROP DATABASE '<DB Name>'
>
>
> However, when I attempt to do this, I get the following error:
>
> Error: Cannot drop the database '<DB Name>' because it is currently in
use.
>
> How can I drop a database when a user is logged into it? Is there a way I
> can programmatically kick people off the database so I can then drop that
> database?
>
>
> Cheers, Jon
>
>
- Next message: Alejandro Mesa: "RE: Programmatically Dropping databases"
- Previous message: David Browne: "Re: Simulate auto increment fields"
- In reply to: Jon Pope: "Programmatically Dropping databases"
- Next in thread: Alejandro Mesa: "RE: Programmatically Dropping databases"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|