/****** Object:  Trigger [TRG_EST_WMS_ENT_PEND_EXCLUI]    Script Date: 24/10/2014 14:34:50 ******/
IF  EXISTS (SELECT * FROM SYS.TRIGGERS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[TRG_EST_WMS_ENT_PEND_EXCLUI]'))
DROP TRIGGER [dbo].[TRG_EST_WMS_ENT_PEND_EXCLUI]
GO
GO
CREATE TRIGGER [dbo].[TRG_EST_WMS_ENT_PEND_EXCLUI] ON [dbo].[EST_WMS_ENT] FOR UPDATE AS
	begin
		DELETE 
		     EST_WMS_ENT_PEND
		FROM
			EST_WMS_ENT_PEND INNER JOIN EST_WMS_ENT ON
			EST_WMS_ENT_PEND.CD_PED_WMS = EST_WMS_ENT.CD_PED_WMS
		WHERE
			EST_WMS_ENT.STS_PED = 1
	end

