Storing User Logs in SQL

  • In my co-operation we have a database which users are making changes on it. What I am trying to do is;

    I want to store all changes on the database, the user’s information logs and I want to store it on a specific table. But I am facing a difficulty to make this.

    For example,

    if a user makes a change on the database, I want to store what kind of change does he/she makes, the time of the process and users information (IP address, login id) on another specific table thus I can store the process logs of my users.

    In my testing I can store the user’s login_id, user’s ip addresses and the login info with using

    sys.syslogins

    sys.dm_exec_connections

    sys.dm_exec_sessions

    except storing the requested queries and the changes of the processes. Is it possible to store logs of the users? How can I do that?

    I will be appreciated of your help.

    Regards,

  • i use sessions and connections dmv's to store this including queries. with queries it takes up a lot of space. a lot.

    write a join depending on the columns you want. do a select into the first time to have it create the table for you and then change it to an insert

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

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