????????????????????????????????????????????ī?????????????SQL Server????????????????????????????????????????????????????????????????Trace??CDC????Trace??????????????????????????????????CDC?????????????SQL Server Audit?????????????
??????SQL Server?У????????????????????????????????????????????伴??????????£?
????SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseName?? last_user_update??*
????FROM sys.dm_db_index_usage_stats
????WHERE database_id = DB_ID( 'DateBaseName')
????AND OBJECT_ID=OBJECT_ID('TableName')
???????????????????????????????????????????????????Server Audit??Server Audit???????????????????洢???????????????????????????????????????????????????????
??????????????????T-SQL????

 

USE master
CREATE SERVER AUDIT audit1 TO FILE (FILEPATH='D:SQLAudit')
USE AdventureWorks2012
CREATE DATABASE AUDIT SPECIFICATION SerialPic FOR SERVER AUDIT audit1
ADD(UPDATE??INSERT??DELETE ON Person.Address by dbo)
USE master
CREATE SERVER AUDIT audit1 TO FILE (FILEPATH='D:SQLAudit')
USE AdventureWorks2012
CREATE DATABASE AUDIT SPECIFICATION SerialPic FOR SERVER AUDIT audit1
ADD(UPDATE??INSERT??DELETE ON Person.Address by dbo)

????????????????????????????????????????D??SQLAudit?У????????????????????????????????????У?????Person.Address???Update??Insert??Delete??????
??????????????????????Person.Address??????-????2????????????1?????

?????1.????????

??????????2?????

?????????????????????????????????????Щ???????????UI?????????????T-SQL????????????
????SELECT * FROM
????fn_get_audit_file('D:SQLAuditaudit1_B8A7821A-D735-446D-B6FA-DF582AB80375_0_130648999540780000.sqlaudit'?? default?? default)