Microsoft® SQL Server® 2012 Bible

(Ben Green) #1

972


Part VII: Monitoring and Auditing


FIGURE 42-2
Creating a new Server Audit Specifi cation using Management Studio.

Creating with T-SQL
Using T-SQL’s create command, it’s easy to create a new Server Audit Specifi cation. The
principal parameter is the add(action group) option, which confi gures the Server
Audit Specifi cation with action groups. The following command creates a Server Audit
Specifi cation and assigns it to the SQL Server 2012 Bible Audit:

CREATE SERVER AUDIT SPECIFICATION
[ServerAuditSpecification-20110801-212943]
FOR SERVER AUDIT [SQL Server 2012 Bible Audit]
ADD (DBCC_GROUP),
ADD (FULLTEXT_GROUP),
ADD (DATABASE_CHANGE_GROUP)
WITH (STATE = ON)

c42.indd 972c42.indd 972 7/31/2012 10:17:48 AM7/31/2012 10:17:48 AM


http://www.it-ebooks.info
Free download pdf