Database is in use
Stop Connections to the database without single user and without script...
System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use
Error:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Restore failed for Server 'ServerName'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.4035.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: Exclusive access could not be obtained because
the database is in use. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.4035.00&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
Solution:
1- Open SQL Management Studio.
2- Management.
3- Activity Monitor.
4- Stop any connection to the selected database.
you can also stop the web application in the IIS web server until you restore the database then start it again
ReplyDelete