• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

Trigger Quick Problem

I could probably figure this out, but I got so much going on.

I am trying to create a trigger.  Here is the SQL:

CREATE TRIGGER TL_Calibration_Date_Trigger_Ins
ON TL_Calibration
AFTER INSERT  
UPDATE TL_Calibration SET [Next Calib] = DATEADD(day, InspectionFrequency, [Last Calibrated])
GO

The actual "Update" statement DOES work, but it don't seem to work in the trigger creation.  I am getting "Error Near Update"

Thanks,
CR
0
chrisryhal
Asked:
chrisryhal
  • 2
1 Solution
 
mikelittlewoodCommented:
CREATE TRIGGER TL_Calibration_Date_Trigger_Ins
ON TL_Calibration
FOR INSERT AS
UPDATE TL_Calibration SET [Next Calib] = DATEADD(day, InspectionFrequency, [Last Calibrated])
GO

I think that is how to define it
0
 
mikelittlewoodCommented:
Maybe in your case

CREATE TRIGGER TL_Calibration_Date_Trigger_Ins
ON TL_Calibration
AFTER INSERT AS
UPDATE TL_Calibration SET [Next Calib] = DATEADD(day, InspectionFrequency, [Last Calibrated])
GO
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now