Quantcast
Channel: Red Gate forums: SQL Backup 7
Viewing all articles
Browse latest Browse all 713

Using 'master..sqlbackup' to do virtual restore

$
0
0
I have SQL Backup with Virtual Restore licensed. I would like to use the SQL Backup extended stored proc to perform a virtual restore but the script shown below always does a full restore.
Is this possible and if so, can you point-out why the script is bad? It is my impression that .vmdf and .vldf extensions signal a virtual restore.

DECLARE @ec int
DECLARE @sec int

EXECUTE master..sqlbackup '-SQL "RESTORE DATABASE [MyDB_Restored] FROM DISK = ''D:\SQLBackup\MyDB\*.sqb'' SOURCE = ''MyDB''
LATEST_ALL WITH RECOVERY, DISCONNECT_EXISTING, MOVE ''MyDB_Data'' TO ''F:\SQLDataVirtual\MyDB.vmdf'',
MOVE ''MyDB_Log'' TO ''F:\SQLDataVirtual\MyDB_Log.vldf'', REPLACE, CHECKDB = ''NO_INFOMSGS, ALL_ERRORMSGS'', DROPDB"', @ec OUT, @sec OUT

Viewing all articles
Browse latest Browse all 713

Trending Articles