Monday, January 21, 2013

tabellenzugriff mittel sql server audit überwachen


ab sql2008, im ssms unter security (server und database)


USE master ;
GO
-- Create the server audit.
CREATE SERVER AUDIT hewMicSqlServerAuditTest TO APPLICATION_LOG ; -- windows application log
--alternative: TO FILE  (FILEPATH ='c:\temp\' );
GO
-- Enable the server audit.
ALTER SERVER AUDIT hewMicSqlServerAuditTest WITH (STATE = ON) ;
GO
-- Move to the target database.
USE hewmicTest ;
GO
-- Create the database audit specification.
CREATE DATABASE AUDIT SPECIFICATION testSpec FOR SERVER AUDIT hewMicSqlServerAuditTest
ADD (SELECT , INSERT ON dbo.testTable BY dbo )
WITH (STATE = ON) ;
GO

No comments: