I have a Database on SQL Server 2008, which I want to drop. Currently it is in single user mode and it is currently in use.
select * from sys.sysprocesses
returns
Msg 924, Level 14, State 1, Line 1
Database 'G_MAIN_DE' is already open and can only have one user at a time.
and I do not know how to identify the session I have to kill.
An attempt to set it offline
ALTER DATABASE G_MAIN_DE SET OFFLINE WITH ROLLBACK IMMEDIATE
yields
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.