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?
I am implementing an inserted trigger and am considering using ORIGINAL_LOGIN function to capture
Share
SYSTEM_USERpresents you with the credentials used to run the query. This is important to establish which permissions were active.ORIGINAL_LOGINis giving you the user with which the connection was established. This is also important information.SYSTEM_USER
you don’t know who originally created the connection
ORIGINAL_LOGIN
To have correct audit results, both need to be logged.