Created
September 4, 2012 18:52
-
-
Save josuebasurto/3624962 to your computer and use it in GitHub Desktop.
SQL Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DB_NAME(dbid) AS DBName, hostname, program_name, cmd, nt_domain, nt_username, net_address, login_time, last_batch, net_library, loginame | |
FROM sys.sysprocesses | |
WHERE (DB_NAME(dbid) NOT IN ('master', 'tempdb', 'msdb')) | |
ORDER BY hostname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This query allows you to watch running from master database the activity of the connections of your databases.
I've tested with sa privileges and didn't try with limited.