If you're restoring from the Object Explorer, then check the
Close existing connections to the destination database box on the Options page of the GUI. If you're restoring using the RESTORE DATABASE statement, you'll need to precede that with:
ALTER DATABASE [SL7system] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
Note, though, that you likely won't need to restore the system database in a case like this.
------------------------------
Jonathan Van Houtte
Architect
XLstatements, LLC
Clifton Park NY
------------------------------
Original Message:
Sent: Jun 24, 2021 10:59 AM
From: Nathan Hammersley
Subject: Restore of System Database Failing
Had some payroll items entered for the wrong weeks and went through posting before it was discovered. Easiest way is to roll back the database to a time before this happenned.
I have done this many times before but am now encountering an error that the System Database Restore failed
No computers are connected but I am getting the following error.
TITLE: Microsoft SQL Server Management Studio
------------------------------
Restore of database 'SL7system' failed. (Microsoft.SqlServer.Management.RelationalEngineTasks)
------------------------------
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use. (Microsoft.SqlServer.SmoExtended)
Any Thoughts??
------------------------------
Nathan Hammersley
Hammersley Stone CO
Fitchburg
------------------------------