Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using a trigger on an audit table may cause multiple entries
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Using a trigger on an audit table may cause multiple entries
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01198853
Message ID:
01198853
Vues:
61
I have a major application which uses ASP and ADO.
There is a Trigger on a table and the code is:
CREATE TRIGGER [QPRCopy] ON dbo.QPR 
FOR INSERT, UPDATE
AS

BEGIN
	INSERT INTO QPRAudit
	SELECT * FROM Inserted
END
The intent of this code is to have an audit trail for each entry of the table of interest. However, the results are strange. On occasion I will have one entry from QPR into QPRAudit. More often than not I will have multiple entries in QPRAudit say from 2 –35 rows for the same QPR record. When there are multiple entries the timestamp is the same for all related records.

By the way as soon as the user selects Save, the Save button is disabled so the problem is not due to users pressing Save multiple times. Does anyone have any suggestions?

I am using this technique on many tables for my application.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform