I am implementing an inserted trigger and am considering using ORIGINAL_LOGIN function to capture the current executing user. I would like to know the pros and cons of using ORIGINAL_LOGIN for auditing. Under what scenario does SYSTEM_USER provide a better alternative to ORIGINAL_LOGIN?
SYSTEM_USER
presents you with the credentials used to run the query. This is important to establish which permissions were active. ORIGINAL_LOGIN
is giving you the user with which the connection was established. This is also important information.
To have correct audit results, both need to be logged.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With