Posted by blueboy on 02/22/07 18:53
Many thanks for that it seems to be what i was after however i keep
getting an error -
The job failed. The Job was invoked by User domainname\user. The
last step to run was step 2 (Restore). The job was requested to start
at step 1 (Kill connections).
here is the scripting i have;
kill connections -
ALTER DATABASE {db name} SET SINGLE_USER WITH ROLLBACK IMMEDIATE
Restore -
RESTORE DATABASE {db name}
FROM DISK =
'E:\folde\{db name} .bak'
WITH MOVE 'Logical_Name_Data' TO 'G:\SQLDATA\MSSQL\data\{db name}
_Data.MDF',
MOVE 'Logical_Data_Log' TO 'G:\SQLDATA\MSSQL\data\{db name}
_Log.LDF',
STATS = 1, REPLACE
GO
It stops at step 2 i also notice when i go back into the steps they
are defaulting back to the master database??
Any help much appreciated
[Back to original message]
|