July 18, 2005 at 4:12 am
Hi Folks,
Just wondering if anyone can help me out. I need to identify the number of users who are currently logged onto a database. I have been monitoring the logins through the SQL profiler. I now want to select the number of users that are logged onto the database on an hourly scale...
2 15 NULL 4668 LaunchLogin oconnellma 83 9763 2005-07-11 09:36:19.570 2005-07-11 09:36:29.333
3 14 NULL 2604 Microsoft® Access cullyk 83 NULL 2005-07-11 09:36:35.803 NULL
Basically the 3 cols that I have higlighted here are the ones that will be used in the query... The first- the one in red is the application; thus I want to catch all the logins grouped by the Launchlogin app. and on an hourly incremental basis; i.e. group by the hour...
Just wondering if anyone can give me even some psuedo code to group by the hour...
Thanks,
M
July 18, 2005 at 9:22 am
Select ApplicationName, Convert(varchar(13), StartTime,121) as Dte, Count(*) NoOfUsers
from YourTraceTable
group by ApplicationName, Convert(varchar(13), StartTime,121)
order by 1,2
* Noel
July 26, 2005 at 7:51 am
...which means you either manually have to save a trace table every time you want the stats, schedule a trace to run for a certain time period per day and automatically load it into a table.
//Hanslindgren
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply