Show TOC

AUDITING Option [database]Locate this document in the navigation structure

Enables and disables auditing in the database.

Allowed Values

ON, OFF

Default

OFF

Scope

Option can be set at the database (PUBLIC) level only.

Requires the SET ANY SECURITY OPTION system privilege to set this option. Takes effect immediately.

Remarks

Auditing is the recording of details about many events in the database in the transaction log. Auditing provides some security features, at the cost of some performance. When you turn on auditing for a database, you cannot stop using the transaction log. You must turn auditing off before you turn off the transaction log. Databases with auditing on cannot be started in read-only mode.

For the AUDITING option to work, you must set the auditing option to ON, and use the sa_enable_auditing_type system procedure to indicate the types of information to audit, including any combination of permission checks, connection attempts, DDL statements, public options, triggers. Auditing will not take place if:

  • The AUDITING option is set to OFF, or
  • Auditing options have been disabled.

If you set the AUDITING option to ON, and do not specify auditing options, all types of auditing information are recorded.