I try to schedule either a job or a DTS package that will restore a db from
backup. No other connection exist on that db but apparently I receive the
message that Restore failed because exclusive access to the db could not be
obtained. I assume that the connection that is counted is the connection of
the job itself.
Can anyone help ?Hi ,
Your message confirms that there is some existing connection in the database
when you are try to restore. So please add the below script along with your
DTS package.
use master
go
declare @.x varchar(255)
select @.x = @.x + " kill " + convert(varchar(5), spid)
from master.dbo.sysprocesses
where dbid = db_id ('dbname')
exec (@.x)
go
Please replace the dbname with your database name in the script.
Thanks
Hari - MCDBA
US Software
Trivandrum
"Andreas" <andreasy@.netu.com.cy> wrote in message
news:uZ7hY6aVDHA.2224@.TK2MSFTNGP09.phx.gbl...
> I try to schedule either a job or a DTS package that will restore a db
from
> backup. No other connection exist on that db but apparently I receive the
> message that Restore failed because exclusive access to the db could not
be
> obtained. I assume that the connection that is counted is the connection
of
> the job itself.
> Can anyone help ?
>
No comments:
Post a Comment