答案 0 :(得分:1)
select * FROM sys.traces where is_default = 1 ;
此查询包含路径列。复制跟踪文件的路径,现在使用以下查询
SELECT * FROM fn_trace_gettable('Path Column value from sys.traces', default)
select ObjectName, LoginName
from ::fn_trace_gettable( 'Path Column value from sys.traces', default)
where EventClass in (46,47,164) and EventSubclass = 0
and DatabaseID = db_id() ;
select ObjectName,
ObjectID,
DatabaseName,
StartTime,
EventClass,
EventSubClass,
ObjectType,
ServerName,
LoginName,
NTUserName,
ApplicationName
from ::fn_trace_gettable( 'Trace File Path', default )
where EventClass in (46,47,164) and EventSubclass = 0 and DatabaseID = db_id();
<强> SQL Server – Auditing Schema Changes using DDL Triggers 强>
此方法将告知添加了哪个列,或者使用了哪个命令来添加