• As for scaling, I am not sure how well it would handle thousands of logins per second. My best advice would be to add at the begining of the trigger a exit clause that covers 90% of the cases, i.e.

    1) the sql server service account logging from the local server

    2) the application service service account where HostName in (list of app servers)

    3) and/or ApplicationName = '<Application Name>'

    4) any member of the sa role (perhaps hardcoding the members of your dba team)

    /* ----------------------------- */
    Tochter aus Elysium, Wir betreten feuertrunken, Himmlische, dein Heiligtum!