I have 2 triggers on the SHIPPING_CONTAINER table when I run a packing functions I get an error
If I turn either trigger off the other works is whne I have both enabled the error is returned. I not to experienced in Triggers so I may be missign something obvious
Trigger 1 Moves the Tare weight from Truck table to a user defined fiedn in the shipping container for company 318 only
Trigger 2 - adds a C to the end of the container ID
Any help with this is appreciated
Thanks
RJL
Code:
Maximum Stored Procedure, Function, Trigger, Or View Nesting Level Exceeded (limit 32)
If I turn either trigger off the other works is whne I have both enabled the error is returned. I not to experienced in Triggers so I may be missign something obvious
Trigger 1 Moves the Tare weight from Truck table to a user defined fiedn in the shipping container for company 318 only
Code:
BEGIN
UPDATE SHIPPING_CONTAINER SET
SHIPPING_CONTAINER.USER_DEF1 = T.EMPTY_WEIGHT,
SHIPPING_CONTAINER.CONTAINER_COUNT_NUMBER =
(SELECT COUNT(CONTAINER_TYPE) FROM SHIPPING_CONTAINER SC
WHERE I.INTERNAL_SHIPMENT_NUM = SC.INTERNAL_SHIPMENT_NUM AND
SC.CONTAINER_TYPE = 'Trailer')
FROM INSERTED I
INNER JOIN SHIPPING_CONTAINER
ON I.INTERNAL_CONTAINER_NUM = SHIPPING_CONTAINER.INTERNAL_CONTAINER_NUM
INNER JOIN WEPK_TRANSLOAD_TRUCK T
ON I.CONTAINER_ID = T.TRUCK_NUM
WHERE
SHIPPING_CONTAINER.COMPANY = '318'
AND ISNULL(SHIPPING_CONTAINER.STATUS,0) > 650
AND I.INTERNAL_CONTAINER_NUM = SHIPPING_CONTAINER.INTERNAL_CONTAINER_NUM
END
Trigger 2 - adds a C to the end of the container ID
Code:
BEGIN
UPDATE SHIPPING_CONTAINER
SET SHIPPING_CONTAINER.CONTAINER_ID = SHIPPING_CONTAINER.CONTAINER_ID + 'C'
FROM INSERTED I
WHERE
SHIPPING_CONTAINER.COMPANY <> '278'
AND ISNULL(SHIPPING_CONTAINER.STATUS,0) > 650
AND I.INTERNAL_CONTAINER_NUM = SHIPPING_CONTAINER.INTERNAL_CONTAINER_NUM
AND RIGHT(SHIPPING_CONTAINER.CONTAINER_ID,1) != 'C'
AND (SELECT LEADING_STS FROM SHIPMENT_HEADER
WHERE SHIPMENT_HEADER.INTERNAL_SHIPMENT_NUM =
I.INTERNAL_SHIPMENT_NUM) > 300
END
Any help with this is appreciated
Thanks
RJL