Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tracking table History
Message
 
 
À
01/02/2006 07:19:25
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Divers
Thread ID:
01092256
Message ID:
01092267
Vues:
19
This message has been marked as a message which has helped to the initial question of the thread.
>I need to track changes / history of a user table. I have created a history table, and would like to put a trigger on the table to be tracked, inserting into the history table those columns which are modified each time. I can create the trigger with a number of 'IF UPDATE (column)' statements, but was wanting a more elegant way of doing this. Any suggestions?? As always, any help is greatly appreciated.

You can write a program/script that would generate a trigger for you. This way you simply regenerate a trigger every time table changes or use it for any other table. There're also commercial products that you can use, for example Apex SQL Audit http://www.apexsql.com/sql_tools_audit.asp

>P.s. - this table should be modified one row at a time. There should not be any bulk inserts.

I wouldn't assume that. The trigger should be designed to work properly in both scenarios.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform