query to get updates/inserts done everyday

  • Hi,

    Is there any query to know what type of changes done by users on sql server tables?

  • Not unless you have some form of auditing or change tracking in place.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • what are those? How can i implement them?

  • Depends on your requirements and version. In SQL 2005, triggers are the main ones, on all tables with audit tables that they write into. On 2008 you also have Change Tracking and Change Data Capture. I've seen replication used, but it's hard.

    Do some reading on auditing, there'll be lots of material.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • For developers, Its just a good practice to implement logging in the application.

    (let the data base be just it)

    you can create it in the business layer and hook all calls insert/update/delete as you wish.

    If you are a .Net developer try it:

    http://www.codeproject.com/Articles/140911/log4net-Tutorial

    if not, I'm sure you can find equivalent tools for you environment.

    For a final tough, the users you refer (usually) are not that account used to connect to the DB.

    good study time.

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

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