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

CREATE TRIGGER DELETE_PROGOPER ON MENUOPER
FOR DELETE
AS
BEGIN
   DELETE FROM PROGOPER
   WHERE CDOPERADOR+CDTELAPROG IN (SELECT CDOPERADOR+DSBPLOPER FROM DELETED);
END;

GO

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

