Well you have to tell the server that is to do the restore to do so, not
some other serve.r..
If linked-servers were in place you could
1. Create a proc in the "target" server called sp_MyRestore
2. On the "job" server exec LinkedServer.master.dbo.sp_MyRestore
? Dano
-----Original Message-----
From: Gerald Hopkins
[mailto:mssqldba-ezmlmshield-x88502892.[Email address protected]
Sent: Wednesday, March 29, 2006 3:26 PM
To: LazyDBA Discussion
Subject: RE: Sproc for Restore
Importance: Low
Thanks. I thought about that, but will it work if the sproc resides in a
database on a different machine than the machine where I want to restore
MyDB?
Gerald Hopkins
-----Original Message-----
From: Mordechai Danielov
[mailto:mssqldba-ezmlmshield-x63804676.[Email address protected]
Sent: Wednesday, March 29, 2006 10:22 AM
To: LazyDBA Discussion
Subject: RE: Sproc for Restore
USE MASTER
GO
RESTORE DATABASE MyDB
FROM DISK = 'D:\MSSQL\BACKUP\MyDB.bak'
WITH RECOVERY,REPLACE,
MOVE MyDB TO 'D:\mssql\data\MyDB.mdf',
MOVE 'MyDB_log' TO 'D:\mssql\log\MyDB_log.ldf'
Go
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY Website :
http://www.LazyDBA.com To unsubscribe:
http://www.lazydba.com/unsubscribe.html
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY Website :
http://www.LazyDBA.com To unsubscribe:
http://www.lazydba.com/unsubscribe.html
MS Sql Server LazyDBA home page