Solved

SQL Query to show all users logged into one instance

Posted on 2008-10-16
3
1,142 Views
Last Modified: 2012-05-05
I need to know write a query to show all users logged into a particular instance of a MS SQL 2005.

This instance contains multiple databases.

I know of sp_who and sp_who2 but that only seems to give me information for one database at a time.

I am looking for an aggregate of all users on all databases in a single instance.
0
Comment
Question by:hyphenpipe
3 Comments
 
LVL 60

Accepted Solution

by:
chapmandew earned 500 total points
ID: 22733929
select * from sys.dm_exec_sessions
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22734000
sp_who and sp_who2 give you connections to every database.  That's why there is a dbName column.
0
 
LVL 6

Author Comment

by:hyphenpipe
ID: 22734202
You are correct.  I was to hasty in looking at the result set.  Thanks.
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

Suggested Solutions

Title # Comments Views Activity
Two tables - Sum of values - What is the difference 31 51
Query 14 55
Query to return total 6 19
Help Required 2 33
Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

803 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