Logging transactions for all user tables in DB from one object(trigger / proc)

  • Hi

    I have around 20 tables in DB and I need to log all transactions happening for all tables. One solution is to create a trigger for each table which we need to avoid. please let me know if there is some way using which I can do by writing a single trigger or proc.

    Cheers

    Siddarth

  • And what version of SQL server are you talking about? In SQL 2005 you can use C2 audit option, for example...

    http://www.sqlservercentral.com/articles/Monitoring/basicsofc2auditing/1547/

  • we are using sql 2005

    thanks for the link

  • I have gone through the link and came to know that it will log the details for all tables in DB. We do not need logging for all the tables, we need to have a facility to make the selection, please let me know if you have something catering to the same?

    Cheers

    SIDDARTH

  • I need to log all transactions happening for all tables

    We do not need logging for all the tables

    1. Please, make up your mind. 🙂

    2. In SQL 2005 there is no such built in ability. In SQL 2008 - you can. Looks like, your only option is still with triggers.

  • If you are inserting, deleting and updateing via stored procedures , then you can modify these to insert data into the audit tables whenever they are called, i prefer this method over triggers.

Viewing 6 posts - 1 through 5 (of 5 total)

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