Vytux

  • Increase font size
  • Default font size
  • Decrease font size
Home DUK Naudingi Kodai List all user connected to a database

Create PDF Email Print

List all user connected to a database

Author:
Vytautas
Date added:
Thursday, 26 February 2009

Answer

The following query will list all users and information who are connected to the specified database.
1
2
3
SELECT spid, status, loginame, hostname, blocked, DB_NAME(dbid) AS database_name, cmd 
FROM master..sysprocesses 
WHERE DB_NAME(dbid) = 'your_db_name'

This is best run under a administrative user such as 'sa' if you want to display all users, otherwise only users you are allowed to see will be shown.

Category

Tags for this item

Discount Hotel Reservation - HotelClub

Reklamos


Lietuviški Vardadieniai


Vakar (2012-02-05) : Agota, Birutė, Gaudvinas
Šiandien (2012-02-06) : Alkis, Darata, Titas, Živilė, Žyvilė
Rytoj (2012-02-07) : Jomantė, Ričardas, Romualdas, Vilgaudas
Made by: Vytux!