SQL Audit log when data in a tables are SELECTED/used

Viewed 19

I have a table with different reports in one of the columns

Report Name SQL
Report A select * from tableA
Report B select * from tableB

I would like to store a audit log with data from when the diferent reports was executed. Audit log example.

Database Date Report User
X1 15/12/2021 Report A Jason
X2 08/03/2022 Report B Andrew
X1 12/03/2022 Report A Andrew

How to achive this. I understood triggers can only handle UPDATE, INSERT, DELETE, but this is a select statement.

0 Answers
Related