Tuesday, March 27, 2012

Best to clear users before detaching a database.

What is the best way to clear users before using the stored procedure to
detach a database? I'm thinking about just writting a script to kill their
process before doing the detach command.
Thanks
Don
Alter Database FooDB set offline with rollback immediate
go
Alter Database FooDB set online
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Don" <Don@.discussions.microsoft.com> wrote in message
news:70D2D8A6-80A4-4A61-81A7-169AFED7AECB@.microsoft.com...
> What is the best way to clear users before using the stored procedure to
> detach a database? I'm thinking about just writting a script to kill
> their
> process before doing the detach command.
> Thanks
> Don
|||Don,
EM provides this option (CLEAR) when you detach a database graphically -
also asks if notificition should passed on to disconnected users.
HTH
Jerry
"Don" <Don@.discussions.microsoft.com> wrote in message
news:70D2D8A6-80A4-4A61-81A7-169AFED7AECB@.microsoft.com...
> What is the best way to clear users before using the stored procedure to
> detach a database? I'm thinking about just writting a script to kill
> their
> process before doing the detach command.
> Thanks
> Don

No comments:

Post a Comment