473,763 Members | 6,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting Number of Logged On Users to Server

SQL Server 2000 - MSDE 2000

Is there a way to get the number of current users logged into a SQL 2000 Server (also MSDE)? Cant be distinct users as most users are logged into the database using the same login.

--
Tim Morrison

--------------------------------------------------------------------------------

Vehicle Web Studio - The easiest way to create and maintain your vehicle related website.
http://www.vehiclewebstudio.com
Jul 20 '05 #1
4 17625
Tim Morrison (sa***@kjmsoftw are.com) writes:
SQL Server 2000 - MSDE 2000

Is there a way to get the number of current users logged into a SQL 2000
Server (also MSDE)? Cant be distinct users as most users are logged into
the database using the same login.


select count(*) from master..sysproc esses where spid > 50 will give you
a rough number. This will include logins from SQL Agent. Note that the
same user can be using multiple connections from the same application,
and thus be counted more than once.

--
Erland Sommarskog, SQL Server MVP, so****@algonet. se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
hmmm..... thanks for the info. Im surprised there isnt a more definate way
to get this information from SQL.

Tim Morrison

"Erland Sommarskog" <so****@algonet .se> wrote in message
news:Xn******** *************@1 27.0.0.1...
Tim Morrison (sa***@kjmsoftw are.com) writes:
SQL Server 2000 - MSDE 2000

Is there a way to get the number of current users logged into a SQL 2000
Server (also MSDE)? Cant be distinct users as most users are logged into
the database using the same login.


select count(*) from master..sysproc esses where spid > 50 will give you
a rough number. This will include logins from SQL Agent. Note that the
same user can be using multiple connections from the same application,
and thus be counted more than once.

--
Erland Sommarskog, SQL Server MVP, so****@algonet. se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Jul 20 '05 #3
I see that one of the fields is "program_na me" in the sysprocesses table. I
have Crystal Reportsrunning so that is one of the processes. How do I get my
app to report itself as one of those processes like crystal?

Then I can do a 'SELECT count(*) FROM sysprocesses WHERE program_name =
'MyApp'.
TIA

Tim Morrison
"Erland Sommarskog" <so****@algonet .se> wrote in message
news:Xn******** *************@1 27.0.0.1...
Tim Morrison (sa***@kjmsoftw are.com) writes:
SQL Server 2000 - MSDE 2000

Is there a way to get the number of current users logged into a SQL 2000
Server (also MSDE)? Cant be distinct users as most users are logged into
the database using the same login.


select count(*) from master..sysproc esses where spid > 50 will give you
a rough number. This will include logins from SQL Agent. Note that the
same user can be using multiple connections from the same application,
and thus be counted more than once.

--
Erland Sommarskog, SQL Server MVP, so****@algonet. se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Jul 20 '05 #4
You can specify it in the connection string, something like "Applicatio n
Name = etc" Its documented in the ADO/OLE DB/ODBC connection strings
documentation.
"Tim Morrison" <sa***@kjmsoftw are.com> wrote in message
news:CxQyb.3817 93$HS4.3135751@ attbi_s01...
I see that one of the fields is "program_na me" in the sysprocesses table. I have Crystal Reportsrunning so that is one of the processes. How do I get my app to report itself as one of those processes like crystal?

Then I can do a 'SELECT count(*) FROM sysprocesses WHERE program_name =
'MyApp'.
TIA

Tim Morrison
"Erland Sommarskog" <so****@algonet .se> wrote in message
news:Xn******** *************@1 27.0.0.1...
Tim Morrison (sa***@kjmsoftw are.com) writes:
SQL Server 2000 - MSDE 2000

Is there a way to get the number of current users logged into a SQL 2000 Server (also MSDE)? Cant be distinct users as most users are logged into the database using the same login.


select count(*) from master..sysproc esses where spid > 50 will give you
a rough number. This will include logins from SQL Agent. Note that the
same user can be using multiple connections from the same application,
and thus be counted more than once.

--
Erland Sommarskog, SQL Server MVP, so****@algonet. se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp


Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2605
by: Marcin Zmyslowski | last post by:
Hello all! I want to create a page in ASP language which gives me information about currently logged users. I thought to do it by this way: when somebody will log in to page, there will be a value of this user id stored in the table among the other fields in the form which are filling in. After clicking on the button "Log off" the value of the user id will be deleted from the MS SQL Server 2000 database. I would do it, but I don`t know...
3
1313
by: Rod | last post by:
Today and tomorrow we're demonstrating our ASP.NET application to the external business customers who will be using it (this is what would best be called a B2B application). I've set things up so that the users automatically go against our test server for the database. We'll "go live" next week Monday. For some reason, while demonstrating the app, it was causing lots of errors for users. It became apparent that the issue was one...
0
1284
by: roh | last post by:
Hello Friends, We are developing a web based application using DB2 UDB Ver 8.1 FixPack7 and Web Sphere Application Server 6.0. We are facing following issue: When number of users logged into the system are more than 40 application hangs, then we have to manually restart the WebSphere Application server and sometimes reboot the system Place Advise.
1
2125
by: Smalley | last post by:
Need some help please. Have this code and for some reason it is not working correctly. I am not receiving errors, just the table is not being populated at all. I have created the tbl and the frm and when I open up the db, it is not recording the number of users. I am still new to VBA and would appreciate some assistance. I am running Access 2003 Thanks,
6
15422
by: krvrk | last post by:
Hi, I am creating a report for which i need to query a table for total number of users and Concurrent users logged in. The table will contain Username(nvarcar,not null),SessionStart time(datetime, not null), SessionEnd time (datetime,null), SessionID(int,not null) and ConnectGUID(uniqueidentifier, not null) etc can any one help me in finding total and number of concurrent logins per day. Sample Data
2
1604
BradHodge
by: BradHodge | last post by:
Reading a post regarding network security on a linked database, I saw this post by PDog on number of users in a network Environment... I am about to put a very small database (2200 kb back-end) out on the network. I am expecting 75-100 users in the system at any one time. The database is largely Read-Only (with the exception a few record changes made daily). I have had it in use by ~20 users continuously for the last 6 months, and have...
8
3748
by: Mike P | last post by:
What would be the best way of counting the number of users who are currently logged on to a website? I am making the users login against a database of valid users. Would the best way be to add a bool field to the table and set each user to 1 if they are logged in, and 0 if they are not logged in? *** Sent via Developersdex http://www.developersdex.com ***
5
3302
by: Jonathan Wood | last post by:
Greetings, I'm using ASP.NET membership and I'd like to query the number of users in a particular role. I don't want the overhead of returning a dataset and then getting the number of items in it. I'd like to create a stored procedure for maximum efficiency that returns the number of users in a particular role. It appears that role IDs are encrypted in the membership tables so I'm not
13
6757
by: snowinfo | last post by:
Hi all, any way to count the number of users i have logged into my site? any help/code appreciated, craig
4
4277
by: rahullko05 | last post by:
Hi, I am writing a code to display the number of user currently viewing my website at any point of time. for example: for bytes i can see network: 216355 as number of users currently viewing this website currently. Also i want to know how can i get the IP address of machine from where the site is viewed or atleast user has logged in to my website. i want to keep track of this information.
0
10148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10002
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.