Solution:
Step 1: Create a new Logging Table CREATE TABLE [dbo].[LOG_METRICS_TRIGGER_UPDATES]( [EventType] [nvarchar](50) NULL, [Parameters] [int] NULL, [EventInfo] [nvarchar](250) NULL ) ON [PRIMARY]
Step 2: Create a new Trigger CREATE TRIGGER [dbo].[tr_METRICS_upd_METRICS_All] on [dbo].[Metrics] for update as
--...trigger code...
Declare @SQL nvarchar(250) Set @SQL = 'DBCC InputBuffer(' + STR(@@SPID) + ')'
Insert into dbo.LOG_METRICS_TRIGGER_UPDATES Exec (@SQL)
Step 3: Query Logging Table
Select * from [dbo].[LOG_METRICS_TRIGGER_UPDATES] will show the EventInfo field containing DB Name and the outer object call.
|
|
|
|
|