Hi all!
I have a lot of stored procedures, which can insert data into the table.
How can I find which stored procedure inserted the certain row?
I wrote a trigger:
But all I got is:
So, why does object_name(@@procid) always return null instead of object name? And how to find the name of the procedure?
If I store just @@procid - I get lont integer != 0
regards
I have a lot of stored procedures, which can insert data into the table.
How can I find which stored procedure inserted the certain row?
I wrote a trigger:
Quote:
CREATE TRIGGER dbo.TraceTheProcedure ON dbo.SomeTableToTrace FOR INSERT, UPDATE AS Insert into DedugTable Select getdate() as EventTime, object_name(@@procid) as Source, object_id From inserted |
Quote:
date [NULL] 239 date [NULL] 240 etc.. |
If I store just @@procid - I get lont integer != 0
regards