I want to capture users logged int o my database from 9-5 and then get the average per day.
can i please have the guidence
users don't actually login at a database level.
their LOGIN logs into the server, and they may potentially use multipel databases as USERS.
throughout the day you can use something like sp_who2 or sp_whoisactive to see who is currently in.
you can create an extended event to monitor activity on a per-database basis, but you need to know what you really want to monitor; # of connections vs # of users.
You could use a trace to do the same thing, but eventually, extended events will fully replace traces in the future; i believe i read that traces are expected to be deprecated in favor of extended events.
Now what is it you really want to track?
For Example, i have SSMS open , with 6 tabs open on the SandBox database , so that's six spids, all on the same database, but it's still just me...do i count as one user or 6 connections?
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!