Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Trigger: Key Column is Insufficient...

Status
Not open for further replies.

Nickela

MIS
Oct 22, 2002
29
0
0
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top