capture table access

jdr0606
jdr0606 used Ask the Experts™
on
I'm trying to capture user details each time certain tables are accessed.

I've used triggers in the past to capture inserts and updates with user, host, dates etc. detail but not for simple access.

Is there a way to do this.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
ste5anSenior Developer

Commented:
Take a look at the audit capabilities of SQL Server: SQL Server Audit (Database Engine).
SQL Server DBA & Architect, EE Solution Guide
Awarded 2009
Distinguished Expert 2018
Commented:
Yes, you can use SQL Server Audit feature as mentioned by ste5an or use Profiler trace as well..
More on step by step instructions for both here..
https://solutioncenter.apexsql.com/auditing-select-statements-on-sql-server/

Author

Commented:
This could be my solution however I'm running SQL2014 Standard and this appears to only work on enterprise.
Raja Jegan RSQL Server DBA & Architect, EE Solution Guide
Awarded 2009
Distinguished Expert 2018

Commented:
Yes, SQL Server Audit Feature is an Enterprise edition feature whereas Profiler would work fine for any edition of SQL Server

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial