|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Trigger is causing random number of duplicates
Hi,
We are having a problem with a trigger that we use to create records in a history table. It seems to be working fine in our environment here but in the live environment (with up to 100 users) the history table sporadically contains duplicates (sometimes 50 or 60 copies ) all with the same record even the same time stamp . We have no idea what is happening.. I am hoping it is because we have done something stupid with the trigger... ALTER TRIGGER [dbo].[UpdateRosterHistory] ON [dbo].[tblRoster] FOR INSERT,UPDATE AS BEGIN INSERT INTO tblRosterHistory ( fldRosterRuleIdHistoryID, fldRosterRuleId, fldRecurrenceId, fldPersonId, .. snip ) SELECT newid(), history.fldRosterRuleId, history.fldRecurrenceId, history.fldPersonId, ...snip FROM inserted as history END Can anyone give us a clue as to why it works most times and other times we have sooo many duplicates of a change in the history table ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > Trigger is causing random number of duplicates |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|