How to audit column of a table in sql server 2005

  • We need to audit some of the columns of a database. Is there any method apart from the trigger? Also, if any sample trigger is available, please reply with it.

  • You can modify the stored procedures that you use to access the data to use an audit table.

  • We have vendor softwares to access the tables. I want to store the insert, update and delete events in a different table, so that they can be reviewed later.

  • Do you know how to write a trigger?

    If you do, then an audit trigger just inserts changed data into some table. There are articles here on the site (search audit) and lots available. We are happy to help, but it appears you haven't done any work on this yourself

  • Rishi (12/10/2008)


    We have vendor softwares to access the tables. I want to store the insert, update and delete events in a different table, so that they can be reviewed later.

    then you will have to write a trigger or invest in some log-reading software

  • Steve Jones - Editor (12/10/2008)


    Do you know how to write a trigger?

    If you do, then an audit trigger just inserts changed data into some table. There are articles here on the site (search audit) and lots available. We are happy to help, but it appears you haven't done any work on this yourself

    I think you are being unfair in this case Steve. Poster is asking for a method other than trigger so I assume poster knows how to implement audit via triggers.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • Paul,

    I am aware that it can be done using trigger, but dont know how to write a trigger as I have never done it before and I am weak in T-SQL.

  • Rishi (12/10/2008)


    Paul,

    I am aware that it can be done using trigger, but dont know how to write a trigger as I have never done it before and I am weak in T-SQL.

    have a look at this article that explains how to do a simple insert audit trigger

    http://qa.sqlservercentral.com/articles/Administering/auditingyoursqlserverpart1/917/%5B/url%5D

Viewing 8 posts - 1 through 7 (of 7 total)

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