Hello Friends one requriment face last days from my boss was he said me that get all active connection in any database in sql server. mean give me list of all user which are currently connected to the our live database.
so fullfill this requriment with below solution so please write this query it will make your boss happier also
this query is for all database on server.
SELECT db_name(dbid) as DatabaseName, count(dbid) as NoOfConnections,
loginame as LoginName
FROM sys.sysprocesses
WHERE dbid > 0
GROUP BY dbid, loginame
please tell your boss and get increment in your salary.
Tags: Get all active connection for each database in Sql serv
This entry was posted
on Wednesday, October 8th, 2008 at 2:41 am and is filed under Sql Server.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Hello ! I am Arjun Jadeja a Software Engineer by Profession. You can contribute and I will distribute your ideas through this site. Thanks and Enjoy
3 comments so far
Leave a reply