Can a database be restored from a remote backup file using t-sql?

In Sql Server 2005, is there any way to restore a database from a backup file with out having to copy the backup file to the server's hard drive first?

E.g., if I have the backup file on one computer, is there a way using t-sql to restore to a database on a different computer without first having to copy the backup file to physically reside on the target machine?
more ▼

asked Sep 10 '10 at 04:50 PM in Default

user-470 gravatar image

277 18 19 21

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

Absolutely. All of our backups are stored on a network share so the restore command would be like:

RESTORE DATABASE XYZ FROM DISK = N'\ServerName\SharePath\DatabaseBackupFile.bak'
more ▼

answered Sep 11 '10 at 12:05 AM

Fatherjack gravatar image

Fatherjack ♦♦
41.3k 73 77 107

(comments are locked)
10|1200 characters needed characters left

Sure can although I had an issue with a very large database file. Best of luck.


Specifying a Universal Naming Convention (UNC) Name

To specify a network share in a backup or restore command, you should use the fully qualified universal naming convention (UNC) name of the file for the backup device. A UNC name has the form \\Systemname\ShareName\Path\FileName.
more ▼

answered Sep 10 '10 at 06:00 PM

Tim gravatar image

35.5k 32 40 138

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Sep 10 '10 at 04:50 PM

Seen: 3667 times

Last Updated: Sep 10 '10 at 04:50 PM