首页 > 解决方案 > SQL Extended Events Capture Truncate Statements

问题描述

Using Extended Events I am trying to capture TRUNCATE or SWITCH statements that are executed as part of Stored Procedure calls. I can capture when executed in SSMS as an adhoc TSQL statement using the sql_statememnt_completed event for example and filtering on sql_text using LIKE %TRUNCATE% but this does not capture the statement as part of a Stored Procedure execution.

What's the best way to capture the TRUNCATE regardless of where/how it is executed?

Thanks in advance.

标签: sqlaudit

解决方案


推荐阅读