Severity Level 16
Exclusive access could not be obtained because the database is in use.
This error occurs when you attempt to load a backup while users are accessing the database. This error can occur with RESTORE DATABASE or RESTORE LOG. You cannot use the RESTORE DATABASE statement while the database is in use by any user, including yourself.
Use the ALTER DATABASE SET SINGLE_USER to remove users from the database.
Or, wait until all users have finished using the database, and then use the RESTORE DATABASE statement. Make sure that you are not using the database being loaded when you issue the RESTORE DATABASE statement. Although not required, it is best to run the RESTORE DATABASE statement from the master database.
MAKE USE THAT YOU ARE RUNNING THE QUERY FROM THE MASTER DATABASE!
- If you invoke the query under the database you are trying to restore, you will continue to receive the Error 3101.
来自 “ ITPUB博客 ” ，链接：http://blog.itpub.net/10640532/viewspace-598213/，如需转载，请注明出处，否则将追究法律责任。