olahallengren / sql-server-maintenance-solution

SQL Server Maintenance Solution
https://ola.hallengren.com
MIT License
2.91k stars 756 forks source link

Unable to use the restore procedure with the latest commandexecute stored proc by Ola #649

Closed sindu1489 closed 3 weeks ago

sindu1489 commented 2 years ago

hi Sir, I am trying to use this stored procedure for restore for ola backups but it throws the below error Msg 201, Level 16, State 4, Procedure CommandExecute, Line 0 [Batch Start Line 0] Procedure or function 'CommandExecute' expects parameter '@DatabaseContext', which was not supplied.

Could you please advise thanks

sindu1489 commented 2 years ago

I am using BrentOzar Stored procedure for restore and am unable to proceed as it throws the below error. Msg 201, Level 16, State 4, Procedure CommandExecute, Line 0 [Batch Start Line 0] Procedure or function 'CommandExecute' expects parameter '@DatabaseContext', which was not supplied. Please kindly help sir

powderdba commented 2 years ago

you need to update your version of brent's sp_databaserestore procedure. the older versions didn't supply this parameter. the newest version does.

CarlosGzz-SQL commented 2 years ago

Comman

you can update commandExecute to use @DatabaseContext ='master' as default, that will bypass your issue, had the same few days ago.