我在 SQL Server 2008 上有一个数据库,我想删除它。目前它处于单用户模式,并且正在使用中。
select * from sys.sysprocesses
返回
Msg 924, Level 14, State 1, Line 1
Database 'G_MAIN_DE' is already open and can only have one user at a time.
而且我不知道如何识别我必须杀死的会话。
尝试将其设置为离线
ALTER DATABASE G_MAIN_DE SET OFFLINE WITH ROLLBACK IMMEDIATE
产量
Msg 5064, Level 16, State 1, Line 1
Changes to the state or options of database 'G_MAIN_DE' cannot be made at this time. The database is in single-user mode, and a user is currently connected to it.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.