SQL Server: How display current connections to a database and/or table?

Posted on 2009-06-30
Medium Priority
Last Modified: 2012-06-27
Is there a stored procedure or UI command that shows the current live connections to a particular database and more importantly to a table (if possible)?  

For instance, a list of users and when they connected, and what the connection is doing?

MySQL has something like this called "show processlist."  Was wondering if SQL Server had something similar.

show processlist;        [MySQL]

Open in new window

Question by:ZuZuPetals
LVL 75

Accepted Solution

Aneesh Retnakaran earned 500 total points
ID: 24748083
you can see the connections to a database thru   'sp_who2 ' but you wont get the info on the connections to a table
LVL 17

Assisted Solution

pssandhu earned 500 total points
ID: 24748106
You can set up a trace in SQL Profiler and that will show you scripts users are running and determine what tables they are running.
LVL 43

Assisted Solution

by:Eugene Z
Eugene Z earned 500 total points
ID: 24748110
exec sp_who
exec sp_who2
Select * from master..sysprocesses
sysprocesses table
and use sql profiler to see what is running
LVL 57

Assisted Solution

by:Raja Jegan R
Raja Jegan R earned 500 total points
ID: 24748116
Using sp_who2 will help you out.

But DMV's are recommended to start from SQL Server 2005.

SELECT * FROM sys.dm_exec_connections

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Microsoft provides a rich set of technologies for High Availability and Disaster Recovery solutions.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to shrink a transaction log file down to a reasonable size.

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question