I have created the following trigger that I am trying to use to update a work entry table for all of the work entries for a single work item (1 to many). When this trigger fires, I get the following error:
Key column information is insufficient or incorrect. Too many rows were affected by update.
The primary key for the tblArchiveWork table is WorkID
The primary key for the tblArchiveWorkEntries table is WorkEntryID, but the table contains WorkID (one to many)
Any thoughts on why I am getting this error? Thanks for your help.
nickela
CREATE TRIGGER trigtblArchiveWorkPremiumUpdatetblArchiveWorkEntries ON [dbo].[tblArchiveWork]
FOR INSERT, UPDATE
AS
BEGIN
UPDATE tblArchiveWorkEntries
SET PremiumWorkItem = Inserted.PremiumWorkItem
FROM tblArchiveWorkEntries, Inserted
WITH
WHERE Inserted.WorkID = tblArchiveWorkEntries.WorkID
END
Key column information is insufficient or incorrect. Too many rows were affected by update.
The primary key for the tblArchiveWork table is WorkID
The primary key for the tblArchiveWorkEntries table is WorkEntryID, but the table contains WorkID (one to many)
Any thoughts on why I am getting this error? Thanks for your help.
nickela
CREATE TRIGGER trigtblArchiveWorkPremiumUpdatetblArchiveWorkEntries ON [dbo].[tblArchiveWork]
FOR INSERT, UPDATE
AS
BEGIN
UPDATE tblArchiveWorkEntries
SET PremiumWorkItem = Inserted.PremiumWorkItem
FROM tblArchiveWorkEntries, Inserted
WITH
WHERE Inserted.WorkID = tblArchiveWorkEntries.WorkID
END