May 25, 2005 at 4:54 pm
Hello SQLers!
I was wondering if there was a way through Enterprise Manager (or some other source) where I can view who has a connection open to a database.
If you're wondering, I have an application in which several sources are trying to access the database simultaneously (by design), but when I want to do a database RESTORE, I have to make sure that noone has a connection reference to the database.
I would like to be able to determine who has a connection open in order to debug my application efficiently.
Thank you and have a great day!
May 25, 2005 at 5:13 pm
In the Query Analyzer you can execute sp_who or sp_who2
You can also check out this thread:
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=169&messageid=184838
May 25, 2005 at 5:13 pm
Run sp_who in Query Analyzer to view the connections to the current database.
See Brian Knight's stored procedure, usp_Kill_Users, to find a useful way to break those connections so you can place the db in single-user mode.
HTH
Elliott
May 26, 2005 at 6:18 am
You can also look in Enterprise Manager -> management folder -> current activity -> process info.
From this screen you can see all connections and kill users.
May 26, 2005 at 8:18 am
Thank you for your help!
The information is awesome!
May 27, 2005 at 2:20 am
You can also use sysprocesses system table in query analyser where you can decide which are the fields you want..Like cpu,IO utalization,machine name,spid,loginame etc...
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply