Can't connect with user which has trigger logon

  • Dear all

    I try to create trigger for user logon in SQL2008, I can't connect with this user. Error is

    Logon failed for login ‘trg' due to trigger execution.

    Changed database context to ‘blank’.

    Changed language setting to us_english. (Microsoft SQL Server, Error: 17892)

    Let see my picture for more detail

  • Does trg have permissions into the master database?

    I would get rid of the execute as 'trg' in that trigger.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • When I assign this user to "public" of master, and select for this log-table. I login successfully

    But how can I define which login with correct password, which login with wrong password?

    Thanks

  • thang_ngo_2002 (9/28/2011)


    When I assign this user to "public" of master, and select for this log-table. I login successfully

    But how can I define which login with correct password, which login with wrong password?

    Thanks

    Logon triggers don't work in that way. You don't have 1 account write to a logging table if it is a good password and a different account if it is a bad password. Simply log the login attempt and move on (in this case).

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply