[dba-SQLServer] Show users for SQLServer

Darren darrend at nimble.com.au
Tue Nov 13 23:11:54 CST 2007


Hi John

See if this is any good for you it works form QA - Assuming you have access

You can write a wrapper in DAO and return the results - though don't ask me
about that :-)

select count(*)as 'NoOfProcesses' from master.dbo.sysprocesses
--Unrem the line below for specific dBs
--where dbid = db_id('YourdBNameHere') 

select distinct loginame from master.dbo.sysprocesses
where
--Unrem the line below for specific Users
-- loginame = 'userloginnamehere' and 
--Unrem the line below for specific Users
dbid = db_id(' YourdBNameHere ')

See ya

DD
-----Original Message-----
From: John Bartow [mailto:john at winhaven.net] 
Sent: Wednesday, 14 November 2007 11:04 AM
To: dba-sqlserver at databaseadvisors.com
Subject: [dba-SQLServer] Show users for SQLServer

Whats the quickest way to tell if someone is accessing a SQL Server DE DB on
the local PC?
 
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com




More information about the dba-SQLServer mailing list