In the event of an emergency restore in SQL 2000, I used to right
click on a database, choose detach and then the "clear" button to
disconnect all users. I didn't actually detach the database, this just
was my sneak out to disconnect so I could run my restore scripts for
the db backups and the logs. I do have a script that I can run that
loops through the SP_WHO results and kills all the spids, but that
takes time and I don't want to have to build that into my restore
scripts.
Does anyone know of a quick way in SSMS where I can detach users from
a database? There are so many more options, I am wondering if I am
just missing where to click?
Thanks all you gurus out there.
Kristina
Alter Database Foo set offline with rollback immediate
Go
alter database foo set online
Go
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Kristina" <KristinaDBA@.gmail.com> wrote in message
news:1181324410.567760.132940@.k79g2000hse.googlegr oups.com...
> Hi,
> In the event of an emergency restore in SQL 2000, I used to right
> click on a database, choose detach and then the "clear" button to
> disconnect all users. I didn't actually detach the database, this just
> was my sneak out to disconnect so I could run my restore scripts for
> the db backups and the logs. I do have a script that I can run that
> loops through the SP_WHO results and kills all the spids, but that
> takes time and I don't want to have to build that into my restore
> scripts.
> Does anyone know of a quick way in SSMS where I can detach users from
> a database? There are so many more options, I am wondering if I am
> just missing where to click?
> Thanks all you gurus out there.
> Kristina
>
|||On Jun 8, 1:48 pm, "Geoff N. Hiten" <SQLCrafts...@.gmail.com> wrote:
> Alter Database Foo set offline with rollback immediate
> Go
> alter database foo set online
> Go
> --
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
> "Kristina" <Kristina...@.gmail.com> wrote in message
> news:1181324410.567760.132940@.k79g2000hse.googlegr oups.com...
>
>
>
>
> - Show quoted text -
THANKS! I actually did this, but omitted the rollback immediate.
perfect!

没有评论:
发表评论