Skip to main content

Microsoft SQL Server: Restore Database from Network Share

To restore a database backup from a network share without copying it to a local drive, one solution is to map the share using a SQL – Statement:

EXEC sp_configure 'show advanced options', 1

GO
RECONFIGURE
GO
EXEC sp_configure 'xp_cmdshell', 1
GO
RECONFIGURE
GO

EXEC XP_CMDSHELL 'net use N: /delete'
EXEC XP_CMDSHELL 'net use N: \\servername\e$ '
EXEC XP_CMDSHELL 'Dir N:'

It may be necessary to provide your username and password within the “net use” command, e.g.:
net use N: \\servername\share /user:username password

After that, the mapped drive is visible in the Locate Backup File – Dialog and you can start restoring your database.

2014-01-24 11_11_16

Leave a Reply

Your email address will not be published. Required fields are marked *