Re: t-sql to drop database unconditionally

From: John Grandy (johnagrandy-at-yahoo-dot-com)
Date: 05/05/05


Date: Wed, 4 May 2005 15:27:37 -0700

But I don't care, because as soon as I kill ALL the databases (distribution,
publishers, subscriber) -- no matter what state they are in -- I am going to
re-create/re-deploy ALL databases from scratch.

I don't care about losing any data. I just want to nuke everything.

How do I kill the users?

"Mike Epprecht (SQL MVP)" <mike@epprecht.net> wrote in message
news:e%23xkaaPUFHA.3840@tk2msftngp13.phx.gbl...
> Hi
>
> Cope all those into your code. There is not direct way to do this. The
> checks are in place to protect the database.
>
> In the case of replication, the distribution DB would be a total mess if
> you just removed a DB that was involved in replication.
>
> Run the replication removal SP's
> Kill the users
> etc
>
> --
> --------------------------------
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
>
> IM: mike@epprecht.net
>
> MVP Program: http://www.microsoft.com/mvp
>
> Blog: http://www.msmvps.com/epprecht/
>
> "John Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
> news:eQ4h7APUFHA.3636@TK2MSFTNGP14.phx.gbl...
>> does anyone know the T-SQL to drop a database unconditionally -- even if
>> it is participating in replication, has uncommitted transactions, has
>> users with open connections, etc.
>>
>
>



Relevant Pages

  • Re: Distribution Data File Growth
    ... I had all of the pieces (msdb, distribution, master, etc.). ... keep_replication switch, I couldn't get replication 'kicked off' again. ... You can use it to restore ... > the distribution, master, and msdb databases as well. ...
    (microsoft.public.sqlserver.replication)
  • Re: newbie: how-to start a transactionnal replication ?
    ... Look under your SQL Server Agent. ... Now open the Replication Monitor and look to see if the Snapshot Agent has ... then check to see if the distribution agent has applied ... > - server A owns many populated databases ...
    (microsoft.public.sqlserver.replication)
  • Re: newbie: how-to start a transactionnal replication ?
    ... Are you getting any error/status messages when you run your distribution ... Looking for a SQL Server replication book? ... > - server A owns many populated databases ...
    (microsoft.public.sqlserver.replication)
  • SA hungs on starting state (re post)
    ... Connecting to directory service on server osiris. ... The replication generated an error: ... A full synchronization is in progress ... Please restore the databases from a ...
    (microsoft.public.exchange2000.admin)
  • Paper Experiments Part 1
    ... almost any paper can be tuned to kill other paprs. ... anti-imp dats, but also with mov 0,>x imps. ... pairs) replication. ...
    (rec.games.corewar)