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

CREATE TRIGGER DELETE_PROGGRUPOP ON MENUGRUPOP
FOR DELETE
AS
BEGIN
   DELETE FROM PROGGRUPOP
   WHERE CDGRUPOPER+CDTELAPROG IN (SELECT CDGRUPOPER+DSBPLGRUP FROM DELETED);
END;

GO

-- VERSAO --
EXEC ATUVEROBJ 'DELETE_PROGGRUPOP','4.05.054';
GO

