Sql logs

  • hi......

    i hav a table in sql database.i want to keep track of table when i perform any operation on table like update insert n delete.how can i resolve this problem using sql logs

  • harry-453265 (10/23/2009)


    hi......

    i hav a table in sql database.i want to keep track of table when i perform any operation on table like update insert n delete.how can i resolve this problem using sql logs

    the short answer is, you cannot. the sql log doesnt log changes to data. one of the ways to do this, is use triggers to capture when changes are made and log those changes to another table.

    If you search for triggers on this site, you should see articles and scripts which will help you further.

    --------------------------------------------------------------------------------------
    [highlight]Recommended Articles on How to help us help you and[/highlight]
    [highlight]solve commonly asked questions[/highlight]

    Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
    Managing Transaction Logs by Gail Shaw[/url]
    How to post Performance problems by Gail Shaw[/url]
    Help, my database is corrupt. Now what? by Gail Shaw[/url]

  • To use the log you'd need to track down a third party tool that allows you to read it. There's no way natively to read from it.

    Other options, in addition to those mentioned above, would be to set up a filtered server side trace and capture all events against that table. If you can upgrade to SQL Server 2008 you should look into the Change Data Capture utility.

    "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

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

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