Exclusive access could not be obtained because the database is in use

Use Master

Alter Database YOURDB
SET SINGLE_USER With ROLLBACK IMMEDIATE


RESTORE DATABASE YOURDB
FROM DISK = 'C:Program FilesMicrosoft SQL ServerMSSQLBACKUPYOURDB.bak'

use Master

ALTER DATABASE yourdatabasename SET MULTI_USER WITH ROLLBACK IMMEDIATE;

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8337095/viewspace-1060178/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/8337095/viewspace-1060178/

你可能感兴趣的:(Exclusive access could not be obtained because the database is in use)