Friday, July 15, 2011

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

USE [master]
ALTER DATABASE [DatabaseName]
SET SINGLE_USER WITH ROLLBACK IMMEDIATE;

Restore database here.. (hopefully) At first it didn't work, then i refreshed databases, logged out and in again and tried again. Then it worked.

USE [master]
ALTER DATABASE [DatabaseName]
SET MULTI_USER;


No comments:

Post a Comment