How to find the active SQL connections?

 Posted by vishalneeraj-24503 on 11/3/2014 | Category: Sql Server Interview questions | Views: 1498 | Points: 40
Answer:

By Writing below code,we can find active SQL connections:-

SELECT db_name(dbid) as DatabaseName,count(dbid) as NoOfConnections,

loginame as LoginName
FROM sys.sysprocesses
WHERE dbid > 0
GROUP BY dbid,loginame;


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response