Question Locked

How do I determine connected users to a SQL Server 2005 database?

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
A db cannot be restored when there is an open connection. How do I determine who or what has an open connection?

3 replies

by scott_heath

Tony is right, but you can also use the stored procedure sp_who2. Or make a custom stored proc that takes a dbname as a parameter and used DB_ID and a join between sys.processes and master.dbo.sysdatabases to show only the relevant connections. :)

Regards,
Scott

http://scottisageek.spaces.live.com

This discussion is closed to new replies.