日期:2014-05-18 浏览次数:20499 次
USE master CREATE SERVER AUDIT testAudit TO FILE(FILEPATH='D:\TempSelectAudit\') GO CREATE DATABASE AUDIT SPECIFICATION testAudSpec FOR SERVER AUDIT testAudit ADD (SELECT ON HumanResources.Employee BY Public) GO USE master SELECT is_state_enabled,* FROM sys.server_file_audits USE AdventureWorks SELECT is_state_enabled,* FROM sys.database_audit_specifications GO USE master ALTER SERVER AUDIT testAudit WITH (STATE=ON) GO USE AdventureWorks ALTER DATABASE AUDIT SPECIFICATION testAudSpec WITH (STATE=ON) GO SELECT session_server_principal_name, statement, * FROM fn_get_audit_file ('D:\TempSelectAudit\*',NULL, NULL)