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

oo0yuki0oo發表於2013-01-30

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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章