I am using the sql_statement_completed Event in SQL Server 2016 to track all SQL executed on a certain table. I have a Filter on sqlserver.sql_text like %tablename%.

This captures any SQL I execute on the table EXCEPT if a Stored Procedure affects the table.

Is there a way to enhance this Extended Event Session to also track Stored Procedure INSERTs and UPDATEs to my table?

(I have also looked at Change Data Capture, but that doesn't capture the user name that executed the statement)

  • Have you considered using the Audit functionality instead? You can enable it for an object, and it will also capture procedures that touch the table as well. – Nic Jan 11 '18 at 18:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.