IF EXISTS(SELECT * FROM sysobjects O, sysusers U
          WHERE
            o.name = 'DTULTATU_USOCUPOMDESCFOS'  and
            type = 'TR'               and
            u.uid = o.uid             and
            u.name = USER)
   DROP TRIGGER DTULTATU_USOCUPOMDESCFOS
GO

CREATE TRIGGER DTULTATU_USOCUPOMDESCFOS
ON USOCUPOMDESCFOS
FOR INSERT, UPDATE
AS
BEGIN
   UPDATE USOCUPOMDESCFOS
   SET DTULTATU = GETDATE()
   FROM INSERTED
   WHERE USOCUPOMDESCFOS.CDCUPOMDESCFOS = INSERTED.CDCUPOMDESCFOS
     AND USOCUPOMDESCFOS.CDFILIAL = INSERTED.CDFILIAL
     AND USOCUPOMDESCFOS.CDCAIXA = INSERTED.CDCAIXA
     AND USOCUPOMDESCFOS.NRSEQVENDA = INSERTED.NRSEQVENDA
     AND USOCUPOMDESCFOS.NRSEQUITVEND = INSERTED.NRSEQUITVEND;
END;
GO


-- VERSAO --
EXEC ATUVEROBJ 'DTULTATU_USOCUPOMDESCFOS','6.35.004';
GO

