?
Solved

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

Posted on 2009-06-30
4
Medium Priority
?
2,074 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 75

Accepted Solution

by:
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
0
 
LVL 17

Assisted Solution

by:pssandhu
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.
P
0
 
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
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 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
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

765 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