May 29, 2015 at 5:27 pm
Hallo
on several tables on a MSSQL2000 db I put a couple of triggers for auditing purpose, on DELETE and UPDATE:
CREATE TRIGGER dbo.TableAuditDel ON dbo.Table
FOR DELETE
AS
INSERT INTO dbo.TableAudit
SELECT D.*, USER_NAME(), GETDATE(),'Delete',HOST_NAME()
FROM deleted D
From a certain point in time the system started logging more than one record, including seemingly:
- records edited by other users
- records not being edited at all (with no apparent relation with the record being actually edited)
- same identical record, recorded at slightly different intervals of time (this could be possibly due to the fact that triggers insists on related tables too, where multiple records are interested by the editing)
It seems that this happens when multiple operators (tenths) are using the system.
The customer is not willing to upgrade SQL Server to a newer version.
Could you please give me any hint?
May 31, 2015 at 3:16 am
With the trigger code there, that's not possible. That trigger will write into the audit table the rows which were affected by the delete with the host name and user name of the person who ran the delete.
Maybe the problem's in the update trigger?
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
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply