“Microsoft SQL Server Management Studio Restore failed for Server “[Server Name]”…Exclusive access could not be obtained because the database is in use.” – SQL Server Error Message
This Error Message Article explains the SQL Server error message “Microsoft SQL Server Management Studio Restore failed for Server “[Server Name]”…Exclusive access could not be obtained because the database is in use.” and details how to fix the underlying problem that caused it to appear.
The action (in this case a restore) cannot be performed on the SQL database. The error indicates that the database is ‘in use’.
In the situation that caused this error, we could not find a reason for the database to be ‘in use’. We stopped all services related to the application (TEKLYNX CENTRAL) that we could find that may have locked the database.
A few possible solutions:
- Use Activity Monitor feature to determine what application is using the database and stop that application (although Activity Monitor can be used with SQL Express it must be loaded using the full SQL installer not SQL Express according to some blog entries)
- Restart the SQL instance services to force users off (this has been tested successfully)
- Use a SQL command to disconnect and roll back any partial connections and put into single user mode
Related Articles: Unable to Restore a SQL Database Because Database ‘In Use’ – KBA-01597-Z6F6R6
Enable or Disable a Service in Windows – KBA-01212-V9N6Y4
Disconnect Database Users with the SET SINGLE_USER SQL Command – KBA-01598-Y7R6C7
Issue Found: Windows 2008R2, running SQL Server 2008R2
Related Link: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/aad41cbb-10cb-4109-9e55-aab048bbeb9d/exclusive-access-could-not-be-obtained-because-the-database-is-in-use?forum=sqldisasterrecovery
- “Contents of item ‘Picture’ cannot be set because its value is invalid” – NiceLabel Print Error
- File Revisions Do Not Synchronize – NiceLabel Cloud Problem
- Transferring a TEKLYNX License – TEKLYNX Instructions
- How to View Licensed Printer Dropoff in NiceLabel Control Center – NiceLabel Instruction Article
- Set Slide Hopper and Label Template for an ESPO Printer – NiceLabel Automation Instruction Article
- Create a Session Timeout – NiceLabel Web Client Instructions