I use the below code to detach my database. Sometimes it fails because there
is an active connection. Is there any command that can overide that
protection or clear the connection without me having to manually detach
inside Ent. Manager?
CODE **********
use master
go
sp_detach_db 'mySQLdatabase'
goHave a look at
http://msdn2.microsoft.com/en-us/library/ms188031(SQL.90).aspx. There's a
section on Obtaining Exclusive Access that tells you how to use ALTER
DATABASE to accomplish what you're trying to do.
Sincerely,
Steve Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"scott" <sbailey@.mileslumber.com> wrote in message
news:uoQm8bgdGHA.1276@.TK2MSFTNGP03.phx.gbl...
>I use the below code to detach my database. Sometimes it fails because
>there is an active connection. Is there any command that can overide that
>protection or clear the connection without me having to manually detach
>inside Ent. Manager?
> CODE **********
> use master
> go
> sp_detach_db 'mySQLdatabase'
> go
>
No comments:
Post a Comment