How can we help you today? How can we help you today?

Restore DB with Encryption password and Move data file and log file but i am getting an error

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 '

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!
Bhavesh
0

Comments

1 comment

  • Eddie D
    Hi Bhavesh,
    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


    Eddie D
    0

Add comment

Please sign in to leave a comment.