Create Database Audit for INSERT, UPDATE, DELETE in SQL Server

There are a few ways to monitor when someone makes an INSERT, UPDATE or DELETE in SQL Server. One quick and easy way is through SQL Server Audit. Below is a step-by-step way to create that audit:

Expand Security, then right-click Audits and click ‘New Audit…’

Create Database Audit 1

Pick how, and where, you want to save the file.

Create Database Audit 2

After choosing where/how to save the file, expand the database, then expand Security, right-click ‘Database Audit Specifications‘ and choose ‘New Database Audit Specification

Create Database Audit 3

The next set of sequences all relate to what objects/permissions/roles you want to audit.

Create Database Audit 4

Create Database Audit 5

Create Database Audit 6

Create Database Audit 7

Output of fn_get_audit_file:

Create Database Audit 8

The code to recreate the above steps is below:

[snippet id=”52″]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.