Restore SQL DB from a network location

This can me done over the network. Just make sure that the account that runs the sql server can access the folder containing the .bak file.

List the files in your database backup using:

RESTORE FILELISTONLY
FROM DISK = 'C:\Projects\Data\Northwind.bak'


Execute the backup using:

RESTORE DATABASE Northwind
FROM DISK = 'C:\Projects\Data\Northwind.bak'

MOVE 'Northwind_Data' TO 'C:\Projects\Web\Data\Northwind.mdf',

MOVE 'Northwind_Data2' TO 'C:\Projects\Web\Data\Northwind.ndf',
MOVE 'Northwind_Log' TO 'C:\Projects\Web\Data\Northwind.LDF'

The replace command will create it from scratch.

Comments

Popular posts from this blog

Execute and access code restricted internals as a partner or customer

Expressions in query ranges

Removing duplicate records