December 28, 2011 at 4:06 pm
Hello. I'm trying to restore a database from a file on a co-worker's machine. When querying the database on the co-worker's machine for backup devices (select * from sys.backup_devices), there are no records. I have access to his database, but not direct access to his drive where the backup files are kept, so I can't copy the backup file to my machine. I don't want to restore to the original database on my co-worker's machine as it's not mine, but I do need data from a previous backup.
The GUI doesn't let you see any network machines, so I've been trying to do this through T-SQL using the RESTORE command. (Example below of what I've tried) However, when running this, I get errors stating the backup device does not exist. The backup was most likely done by right-clicking the database and going to tasks -> backup, there are no "devices" setup.
How do I get the RESTORE command to forget about the "devices" and restore from a network_file_path/name?
Thanks in advance for any help!!
DECLARE @path varchar(1500)
SET @path = '\\chris-db2\F$\sql2008\data\test.mdf'
RESTORE DATABASE test FILE = 'test.mdf'
FROM @path
WITH NORECOVERY,
MOVE '\\chris-db2\F$\sql2008\data\test.mdf' TO 'E:\data\test.mdf'
December 28, 2011 at 8:42 pm
Based on what you have stated your coworker hasn't granted you access to his system to access the file. Also, you have another problem with your restore command, happens to be the MOVE clause of the RESTORE command. The original file location needs to be the same as it is on your coworkers system, not what you have posted.
December 29, 2011 at 12:23 pm
ok thanks!
for future reference though, does that mean that I can restore across a network if I have access?
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply