I have a table in SQL Server 7.0 that has a series of constraints and triggers attached that were created via Enterprise Manager. Each one is run separately, there is no explicit nesting. There are 2 check constraints and 5 triggers. The table also contains 8 foreign keys mapped to other tables.
The 5th trigger is as follows:
I have field called last_update (NOT NULL) with a default of getdate().
My problem is this:
When I attempt an insert on this table it fails with the following message:
Server: Msg 217, Level 16, State 1,
Procedure utr_report_last_update, Line 5
Maximum stored procedure nesting level exceeded (limit 32).
I use this same trigger with no problems with my other tables that have a last_update field. Why is it causing me problems on an INSERT when it is an UPDATE trigger?
The 5th trigger is as follows:
Code:
CREATE TRIGGER utr_report_last_update ON dbo.tbl_incident_report
FOR UPDATE
AS
UPDATE tbl_incident_report
SET last_update=getdate() from tbl_incident_report a, inserted b
WHERE a.report_id=b.report_id
I have field called last_update (NOT NULL) with a default of getdate().
My problem is this:
When I attempt an insert on this table it fails with the following message:
Server: Msg 217, Level 16, State 1,
Procedure utr_report_last_update, Line 5
Maximum stored procedure nesting level exceeded (limit 32).
I use this same trigger with no problems with my other tables that have a last_update field. Why is it causing me problems on an INSERT when it is an UPDATE trigger?