Comments
2 comments
-
Hi
Can you please confirm the syntax you are using?
From your example you appear to be missing the closing two single quotation marks at the end of the move statement for the log file:MOVE ''Logical_name_log'' TO ''Drive:DB_Name.ldf
Where it should be:MOVE ''Logical_name_log'' TO ''Drive:DB_Name.ldf''
Can you please retry your script based on your example using the code below?EXEC master..sqlbackup '-SQL "RESTORE DATABASE [Db_Name] FROM DISK = ''Drive:Filename.sqb'' WITH MOVE ''Logical_name'' TO ''Drive:DB_Name.mdf'', MOVE ''Logical_name_log'' TO ''Drive:DB_Name.ldf'' REPLACE, NORECOVERY"'
Many Thanks
Eddie -
Hi Eddie,
Your right I've missing the closing two single quotation marksThanks a lot for the help it's working fine now.
Cheers!
Regards, Andrian
Add comment
Please sign in to leave a comment.
I'd like to ask if anyone encountered this issue: I'm restoring the database with NORECOVERY option, because I want to restore Differential/Transaction logs backup after. But when i restored the database, I'll expect the database status should be restoring state, but when i checked the database is already accessible and I'm not able to restore the Differential/Transaction log backup. Below are the scripts that I'm using.
EXEC master..sqlbackup '-SQL "RESTORE DATABASE [Db_Name]
FROM DISK = ''Drive:Filename.sqb''
WITH MOVE ''Logical_name'' TO ''Drive:DB_Name.mdf'',
MOVE ''Logical_name_log'' TO ''Drive:DB_Name.ldf REPLACE, NORECOVERY''"'
I'm using SQL Backup v7.7.0.7 server components.
Any help are highly appreciated. Thanks a lot!
Regards, Andrian