代码如下:
use master
exec sp_dboption 'Era','offline','true' 
restore .....
exec sp_dboption 'Era','offline','false'
执行:
use master
exec SP_DBOPTION 'Era','offline','true'
出现提示错误:
Server: Msg 5160, Level 16, State 1, Procedure sp_dboption, Line 435
Cannot take 'Era' offline because the database is in use.
Server: Msg 15245, Level 16, State 1, Procedure sp_dboption, Line 438
DBCC DBCONTROL error. Database was not placed offline.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.