Login access

  • Hi All

    is there maybe a script in SQL to check how many times a day a login access a database?

    Thanks

    A

  • Hi,

    If your goal is to track which account is logging in, a good start would be to enable auditing within SQL Server. This would allow you to see the login events in the Windows event viewer. See this article from Brian Kelley: http://www.sqlservercentral.com/articles/Security/sqlserverauditingpart1/1451/

    You could also run a trace to track login activity and store the output in a log file. This may be easier to look at and search. But it's a bit more manual - it requires starting/stopping the trace.

    Herve Roggero
    hroggero@pynlogic.com
    MCDBA, MCSE, MCSD
    SQL Server Database Proxy/Firewall and Auditing

  • Herve has the only real solutions. This isn't tracked by default, so if you haven't enabled anything, you cannot go back in time.

  • I think there is no such script, bu tyou can create the DDL trigger on database to track the records

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

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