Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sp_restoredatabase error #3604

Closed
rkslife opened this issue Jan 8, 2025 · 1 comment
Closed

sp_restoredatabase error #3604

rkslife opened this issue Jan 8, 2025 · 1 comment

Comments

@rkslife
Copy link

rkslife commented Jan 8, 2025

Version of the script
@Version = '8.23', @VersionDate = '20241228';

What is the current behavior?
Throwing below error when running the restore
Msg 8145, Level 16, State 1, Procedure dbo.CommandExecute, Line 0 [Batch Start Line 4]
@DatabaseContext is not a parameter for procedure CommandExecute.

If the current behavior is a bug, please provide the steps to reproduce.

EXEC dbo.sp_DatabaseRestore @database = 'BillingMgmt', @BackupPathFull = 'C:\TestDB\FULL',
@MoveFiles = 1,
@MoveDatadrive= N'L:\Data\TestDB.mdf',
--@MoveDataDrive = N'L:\Data\TestDB_Second.mdf',
@MoveLogDrive = N'I:\Log\TestDB_log.ldf',@ContinueLogs = 0, @RunRecovery = 0;
GO
What is the expected behavior?

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures?
SQL Server 2022
getting below error when running sp_restoredatabase.

Fixing @BackupPathFull to add a ""
Fixing @MoveDataDrive to add a ""
Fixing @MoveLogDrive to add a ""
Setting default data drive for @MoveFilestreamDrive
Setting default data drive for @MoveFullTextCatalogDrive
@MoveFiles = 1, adjusting paths
@ExistingDBAction 0 so do nothing
@ContinueLogs set to 0
Msg 8145, Level 16, State 1, Procedure dbo.CommandExecute, Line 0 [Batch Start Line 4]
@DatabaseContext is not a parameter for procedure CommandExecute.

@erikdarlingdata
Copy link
Contributor

This isn't a problem with sp_DatabaseRestore. You need to update your Ola Hallengren scripts. It looks like they're over six years old?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants