February 3, 2021 at 9:40 am
I continually get this error each time I restore my databases on SQL Server 2019.I end up using the work around below:
EXEC sp_changedbowner 'sa' .Is there a permanent solution to this issue?
“When I hear somebody sigh, ‘Life is hard,’ I am always tempted to ask, ‘Compared to what?’” - Sydney Harris
February 4, 2021 at 10:10 am
Thanks for posting your issue and hopefully someone will answer soon.
This is an automated bump to increase visibility of your question.
February 18, 2021 at 10:22 am
Below are some reasons that could interfere with the restore process and throw the ‘restore of database failed because the database is in use’ error:
Read this blog.
SQL Database Recovery Expert 🙂
February 18, 2021 at 7:50 pm
On the source system - what principle is defined as the database owner? It appears that the database on the source system is not owned by sa - which leads me to believe that principle does not exist as a login (with the same SID) on the system where you are restoring the database.
Either change the owner on the source system - or make sure the login on the destination system has the same SID as the login on the source system.
Jeffrey Williams
Problems are opportunities brilliantly disguised as insurmountable obstacles.
How to post questions to get better answers faster
Managing Transaction Logs
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply