Solved

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

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now