SQL Audit

  • Hello,

    I created SQL audit for server and I set group called SCHEMA_OBJECT_CHANGE_GROUP, so I want to check all modify operation, but problem is that here is not hostname and IP, and in Default_trace is

    So my idea was join select below with sys.dm_exec_session, but is right that if program/man.studio will be quit the session can have different owner or null.? Because my plan was copy to another table one per day.

    So any idea how can I do ?? I dont want to use Default_trace method, because I read that will not be supported in newer version

    select event_time

    ,A.session_id

    ,B.session_id

    ,HOST_NAME

    ,sequence_number

    ,action_id

    ,class_type

    ,database_name

    ,schema_name

    ,object_id

    ,object_name

    ,statement

    ,succeeded

    ,server_principal_id

    ,database_principal_id

    ,target_server_principal_id

    ,target_database_principal_id

    ,session_server_principal_name

    ,server_principal_name

    ,database_principal_name

    ,target_server_principal_name

    ,target_database_principal_name

    ,server_instance_name

    ,additional_information

    ,file_name

    ,audit_file_offset

    ,user_defined_event_id

    ,user_defined_information

    from fn_get_audit_file( 'F:\SQL_AUDIT\*',DEFAULT,DEFAULT) A

    left join sys.dm_exec_sessions B

    ON A.session_id=B.session_id

    WHERE class_type<>'U'

  • up

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply