Share via

Filtering column on Server Audit Specification

Urbel 525 Reputation points
2026-03-31T04:40:45.1333333+00:00

Hi All,

How to implement column filter on Server or Database Audit specification? I need to exclude [Action ID] SELECT

Great thanks for all respond

warm regards,

UrBel

SQL Server Database Engine
0 comments No comments

Answer accepted by question author
  1. Q&A Assist
    2026-03-31T04:41:25.0833333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    SQL Server Audit does not support filtering directly on the action_id column in the audit specification definition, but action_id can be used as a predicate if it is converted from its character form to a numeric value.

    To exclude SELECT actions, configure the audit with a predicate on action_id that filters out the numeric value corresponding to SELECT. The key point from the documentation is:

    To use action_id as a predicate it must be converted from a character string to a numeric value. For more information, see Filter SQL Server Audit on action_id / class_type predicate.

    In practice, this means:

    1. Create or alter the server or database audit specification.
    2. Use a WHERE predicate on the audit (the audit predicate expression) that compares the converted action_id to the numeric value for SELECT, and exclude it.

    Conceptually, the predicate looks like:

    WHERE CONVERT(int, action_id) <> <numeric_value_for_SELECT>
    

    This predicate is attached to the audit itself (the WHERE clause of the audit specification), not to the table columns. The audit records will still contain action_id along with other columns such as event_time, succeeded, permission_bitmask, etc., but events where action_id corresponds to SELECT will be excluded by the predicate.

    The exact numeric value for SELECT is determined by converting the action_id string for SELECT to its numeric representation, as described in the referenced blog article.


    References:

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.