Trigger query...
i want to be able to insert a new record into another table when a particulare field is updated on the source table, my trigger code is below but will not create in execution, can some spot the school boy error?
CREATE TRIGGER Test ON tbl_ManualItem
FOR UPDATE
AS
IF UPDATE(fk_ItemID)
BEGIN
INSERT INTO tbl_JobJoinItem
(fk_jobID,fk_Itemid,fk_Floorid,fk_Roomid)
VALUES
SELECT fk_jobID,fk_Itemid,fk_Floorid,fk_Roomid FROM Updated
END
i want to be able to insert a new record into another table when a particulare field is updated on the source table, my trigger code is below but will not create in execution, can some spot the school boy error?
CREATE TRIGGER Test ON tbl_ManualItem
FOR UPDATE
AS
IF UPDATE(fk_ItemID)
BEGIN
INSERT INTO tbl_JobJoinItem
(fk_jobID,fk_Itemid,fk_Floorid,fk_Roomid)
VALUES
SELECT fk_jobID,fk_Itemid,fk_Floorid,fk_Roomid FROM Updated
END