Kill all spid's that appear in syslocks table for this dbid, since they are using the database.
Also you could try to put your database offline:
Alter database dbname set offline with rollback immediate
This will rollback any connection using the database and put it in an offline state.
-----Original Message-----
From: Kaustubh Puranik [mailto:mssqldba-ezmlmshield-x34254957.[Email address protected]
Sent: Miércoles, 27 de Abril de 2005 01:49 p.m.
To: LazyDBA Discussion
Subject: Drop database
I can not connect to one of my databases through Query Analyzer or Enterprise Manager. When I try that it is hanging. I found that .ldf file is 30gb and I tried to shrink the file and/or shrink the database it was also hanging. I tried to run DBCC CHECKDATABASE but it never complete. So finally I decided to drop the database using Query Analyzer as I can connect to the master database. When I run the drop command I got error saying database is in use. I checked the sysprocesses table but there is not a single entry for this database. I know no one else is using database right no. I do find one entry into syslocks table... I want to drop the database and restore it from backup... What should I do to drop this database? In this process I restarted the server several times.
Thanks in advance...
k.
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY Website : http://www.LazyDBA.com To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]
MS Sql Server LazyDBA home page