Technical Article

Restore Database from network location

,

Restore DB from network path

When using SQL Server management studio and attempting to restore the DB using the restore dialog, it appears that the backup file must be on the local disk/volume before it can be used for restore.

This is actually not true - it can sit on network path saving sometimes hours in copying backup file accross to local folders.

This script does the trick. Check on the SQL Server documentation about the meaning of WITH REPLACE and various other options that are avaialble with RESTORE DATABASE statement.

RESTORE DATABASE 
    DatabaseNameHere 
FROM 
    DISK='\\server_name\folder\filename.bak' 
WITH REPLACE

Rate

3.67 (15)

You rated this post out of 5. Change rating

Share

Share

Rate

3.67 (15)

You rated this post out of 5. Change rating