SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Session ID question
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

viperbyte
Posting Yak Master

USA
132 Posts

Posted - 12/10/2012 :  16:46:52  Show Profile  Reply with Quote
When I run the following script I get a session count of 85 for a particular login name. And that login name is the name of our inhouse application. We have about 15 to 20 users on that app, max. Shouldn't the session count be between 15 and 20? Shouldn't it be like one session ID for each instance of the running appication, or not necessarily?

SELECT login_name, COUNT(session_id) AS [session_count]
FROM sys.dm_exec_sessions WITH (NOLOCK)
GROUP BY login_name
ORDER BY COUNT(session_id) DESC;

robvolk
Most Valuable Yak

USA
15678 Posts

Posted - 12/10/2012 :  17:12:21  Show Profile  Visit robvolk's Homepage  Reply with Quote
Depending on your connection pooling and how your app calls the database, you could end up with multiple sessions for the same user. 85 is not a large number of connections for a single login, and unless you have hundreds or thousands of connections/sessions that you need to reduce it's not worth worrying about.
Go to Top of Page

viperbyte
Posting Yak Master

USA
132 Posts

Posted - 12/10/2012 :  17:24:30  Show Profile  Reply with Quote
Thanks.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000