Last login for user on spesific table

  • Hi

    Is it possible to get a report for each table in a databse of who last viewed, updated, delteted and so on ?

    I know I can get last login to a databse, but I want to check what table for last login for that user

  • Nope. Not really. There's no tracking mechanism for table, view or index. Not like what you're asking for.

    What you can do is track the queries in the system using Extended Events. With that you can get all stored procedure calls, batch calls and prepared statement calls. From there, if you so desire, you can map it down to table access. That can get you close to what you're asking for, but that's about it.

    What actual problem are you trying to solve?

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • You might be able to get some limited retrospective information from the log. Going forward the following gives an outline and also links to some details on how to access the log:

    https://www.sqlshack.com/various-techniques-to-audit-sql-server-databases/

     

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

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