'How to capture what DML statement has modified the data in the DML trigger?
I have created a DML trigger to capture the data for a table that needs to have track all the data modifications.
I am able to capture the SPID, Hostname, Appname and UserName along with the records changed.
Now, I wanted to capture the DML statement that made the modifications to the records.
For example, I can insert into the table using
- Normal
Insertstatement with values Insert into tableusing selecting the records- Using a
Mergestatement
Similarly, we can have multiple ways to do the other DML operations also like Update and Delete.
I wanted to capture the statement that the user has executed to modify the records.
Is there a way I can get this functionality?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
