Audit enable on a table for select , delete ,insert
https://bradmcgehee.com/2010/03/30/an-introduction-to-sql-server-2008-audit/
db_owner -> nly owner can see the data in the audit file.
public -> it gets inserted in the audit file
To read from the Audit file
SELECT top 10 * FROM sys.fn_get_audit_file ('E:\DBA\PrismAuditForPTR_9D053EB5-1A04-473C-A5DB-7F5A6779B8F6_0_132258070574800000.sqlaudit',default,default);
SELECT top 50 statement
FROM sys.fn_get_audit_file
('E:\DBA\PrismAuditForPTR_9D053EB5-1A04-473C-A5DB-7F5A6779B8F6_0_132258070574800000.sqlaudit',
default,default) where database_principal_name<>'NA\crmdbsvc'
db_owner -> nly owner can see the data in the audit file.
public -> it gets inserted in the audit file
To read from the Audit file
SELECT top 10 * FROM sys.fn_get_audit_file ('E:\DBA\PrismAuditForPTR_9D053EB5-1A04-473C-A5DB-7F5A6779B8F6_0_132258070574800000.sqlaudit',default,default);
SELECT top 50 statement
FROM sys.fn_get_audit_file
('E:\DBA\PrismAuditForPTR_9D053EB5-1A04-473C-A5DB-7F5A6779B8F6_0_132258070574800000.sqlaudit',
default,default) where database_principal_name<>'NA\crmdbsvc'
Comments
Post a Comment