First, there are a couple of things you need to remember.[ol][li]You have to be able to login to check.
[li]A user may have multiple connections for the same process or connections with the same login for different processes.[/ol]To count the number of SQL connections for the current login.
select RecCnt=count(*)
from master..sysprocesses p join master..syslogins l on p.sid=l.sid
where l.name=user_name()
To count the number of SQL connections for a specific login.
select RecCnt=count(*)
from master..sysprocesses p join master..syslogins l on p.sid=l.sid
where l.name='login_name' Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it if you have time.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.