Hi all,
Would be greatful of some help with a DB Query relating to Triggers.
One of our important Triggers was disabled in Production sometime over the weekend and nobody is owning up to it
Is there a query I can run against my SQL Database to give me the history of who stopped this Trigger?
SELECT
[Time], [User], [Action], [TriggerName]
FROM
[dbo].[AuditLogs]
WHERE
[Action] LIKE '%Trigger%'
AND [TriggerName] = 'Trigger Name'
ORDER BY
[Time] DESC;
Well, in that case, you can try the following query as you mentioned the Action are numeric, not text:
SELECT
[Timestamp], [User], [Action], [Message]
FROM
[dbo].[ExecutionAuditData]
WHERE
[Action] IN (2, 3)
AND [Message] LIKE '%INSERT_TRIGGER_NAME_HERE%'
ORDER BY
[Timestamp] DESC;
select dbo.auditlogs.
DisplayName,
ExecutionTime,
Parameters,
dbo.users.Name
from [xxrpa-prd].[dbo].[AuditLogs],
dbo.Users
where dbo.users.Id = dbo.AuditLogs.UserId
and DisplayName = ‘TRIGGER_NAME’
order by ExecutionTime desc