USE MASTER-- Add a new backup device-- Ensure that the SQL Server can read from the physical location where the backup is placed-- TYPE NAME PHYSICAL LOCATIONEXEC
SP_ADDUMPDEVICE 'disk','networkdrive','\\VPCW2K8\Database Backup\Test.bak'-- Execute the Restore operation in VERIFY ONLY mode-- Provide the actual paths where you plan to restore the database.-- This is because VERIFYONLY also checks for available spaceRESTOREVERIFYONLYFROM
networkdriveWITHMOVE
N'TESTDB_DATA'
TO N'E:\TestDB\TestDB_Data.mdf',
MOVE
N'TESTDB_INDEXES'
TO N'E:\TestDB\TestDB_Idx.mdf',
MOVE
N'TESTDB_LOG'
TO N'E:\TestDB\TestDB_LOG.ldf'-- DROP THE DEVICE-- Name , Physical File (OPTIONAL - if present, the file is deleted)EXEC
SP_DROPDEVICE 'networkdrive'
801

被折叠的 条评论
为什么被折叠?



