Skip to content

Instantly share code, notes, and snippets.

@kujhawk94
Last active May 14, 2016 20:53
Get a list of users connected to e-MDs TopsData application
SELECT DISTINCT
loginame [Login],
hostname,
sd.name DBName,
[program_name] ProgramName
FROM master.dbo.sysprocesses sp
JOIN master.dbo.sysdatabases sd ON sp.dbid = sd.dbid
WHERE sd.name = 'TopsData'
AND program_name = 'e-MDs Solution Series'
ORDER BY loginame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment