Hi,
Is there a way that I can capture user access to a specific database, into a table perhaps. I'm just looking to record date and time of login and which database is accessed.;
Any help would be appreciated.
Thanks
Hi,
Is there a way that I can capture user access to a specific database, into a table perhaps. I'm just looking to record date and time of login and which database is accessed.;
Any help would be appreciated.
Thanks
Depending on what version of SQL Server you are using you can use an Audit to track this information. You can also use extended events to watch for locks on the database. If there's a lock then they touched the database. If you want specific tables, using an Audit is probably better suited here.
Hi JohnM,
Many thanks for your response. I am using SQL Server 2012 Standard edition, is there a way I can do this on that version?
Thanks
Unfortunately I don't believe so. You can do server level audits (I think) but database level audits required Enterprise. I would look towards extended events to track this. Or upgrade to SQL Server 2016 SP1 or higher for database audits
I believe you can do database level login triggers even in the standard edition.
18 People are following this question.