Hi Friends,

In my previous blog I describe about auditing and auditing setup using management studio. You can go to that blog by using this link;

Today here we will setup the server level audit using TSQL:

Step 1: Create Server Audit

Note: Here disk space will be reserve (after enabling the AUDITDEMO).

Step 2: Create Server Audit Specification

Step 3: Enable both

Step 4: You can also check that both options are on or not by using below DMVs. If both query return value 1 that means both are enabled

Step 5: JUST DO A TRIAL OF FAILED LOGIN using SSMS (Here I just try to login with a login name DSSS, which not exist on server)

Step 6: Now you can read your Audit log file by using

Output of above code is as shown below:





Prince Rastogi

Like us on FaceBook Follow us on Twitter | Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook