Solved

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

Posted on 2009-06-30
4
2,038 Views
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

0
Comment
Question by:ZuZuPetals
4 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 125 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
0
 
LVL 17

Assisted Solution

by:pssandhu
pssandhu earned 125 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.
P
0
 
LVL 42

Assisted Solution

by:EugeneZ
EugeneZ earned 125 total points
ID: 24748110
exec sp_who
exec sp_who2
 
Select * from master..sysprocesses
more
sp_who
http://msdn.microsoft.com/en-us/library/aa260384(SQL.80).aspx
 
sysprocesses table
http://msdn.microsoft.com/en-us/library/aa260456(SQL.80).aspx
 
---
 
and use sql profiler to see what is running
http://msdn.microsoft.com/en-us/library/ms979207.aspx 
0
 
LVL 57

Assisted Solution

by:Raja Jegan R
Raja Jegan R earned 125 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
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to shrink a transaction log file down to a reasonable size.

809 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