Restore DB with Encryption password and Move data file and log file but i am getting an error
Bhavesh
Posts: 1 New member
in SQL Backup
I want to Restore DB with Encryption password and Move data file and log file but i am getting an syntax error.
Can anyone please help me to give proper syntax for it?
I have below syntax wich is giving an error 'Syntax error: 'LATEST_FULL' after 'mypassword '
Thanks in advance!
Can anyone please help me to give proper syntax for it?
I have below syntax wich is giving an error 'Syntax error: 'LATEST_FULL' after 'mypassword '
EXECUTE master..sqlbackup '-SQL "RESTORE DATABASE [PCC] FROM DISK = ''C:\Users\MedMega-admin\Documents\Backups\*.sqb'' WITH PASSWORD = ''mypassword'' LATEST_FULL WITH MOVE DATAFILES TO ''D:\Data'', MOVE LOGFILES TO ''D:\Logs'', REPLACE " '
Thanks in advance!
Tagged:
Answers
Thank you for your forum post.
Your syntax is incorrect, the LATEST_FULL keyword needs to be beofre the WITH keyword and the WITH keyword appears twice.
Can you please try the syntax below:
EXECUTE master..sqlbackup '-SQL "RESTORE DATABASE [PCC] FROM DISK = ''C:\Users\MedMega-admin\Documents\Backups\*.sqb'' LATEST_FULL WITH PASSWORD = ''mypassword'', MOVE DATAFILES TO ''D:\Data'', MOVE LOGFILES TO ''D:\Logs'', REPLACE " '
https://documentation.red-gate.com/sbu/scripting-sql-backup-pro/the-restore-command
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com