Does anyone know if it is possible (if I have a very long running query) to
...
1. Kill the running spids in the database (without having them
rollback...which itself would take an eternity). I don't care at this point
whether the database becomes suspect (which off course it probably would).
2. I would then Drop the database.
The only way I have managed to do this in the past is to restart the SQL
Service -which is not a very elegant solution and should be unnecessary (in
theory).
Am I missing a command or an undocumented kill parameter.
Many thanks,
Mark."news.microsoft.com" <nospam@.nospam.com> wrote in message
news:e3VCpplNIHA.4740@.TK2MSFTNGP02.phx.gbl...
> Does anyone know if it is possible (if I have a very long running query)
> to ...
> 1. Kill the running spids in the database (without having them
> rollback...which itself would take an eternity). I don't care at this
> point whether the database becomes suspect (which off course it probably
> would).
> 2. I would then Drop the database.
> The only way I have managed to do this in the past is to restart the SQL
> Service -which is not a very elegant solution and should be unnecessary
> (in theory).
> Am I missing a command or an undocumented kill parameter.
> Many thanks,
> Mark.
>
Try:
ALTER DATABASE db1 SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
--
David Portas
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment