x

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, 2010 at 04:50 PM in Default

user-470 gravatar image

user-470
277 19 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, 2010 at 12:05 AM

Fatherjack gravatar image

Fatherjack ♦♦
42.4k 75 78 108

(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.

http://msdn.microsoft.com/en-us/library/ms179313.aspx

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, 2010 at 06:00 PM

Tim gravatar image

Tim
36.4k 35 41 139

(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

By RSS:

Answers

Answers and Comments

SQL Server Central

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

Topics:

x1945
x101

asked: Sep 10, 2010 at 04:50 PM

Seen: 4060 times

Last Updated: Sep 10, 2010 at 04:50 PM