DELETE rel_oper_menus WHERE ejecuta_operacion = 'FCO5030';
DELETE rel_oper_modulos WHERE operacion = 'FCO5030';
DELETE operaciones WHERE operacion = 'FCO5030';
DELETE aut_operaciones WHERE operacion = 'FCO5030';

INSERT INTO operaciones (operacion, descripcion_ope, icono, tipo_operacion)  
VALUES ('FCO5030', 'Archivos para la DIAN', 4, 1);

INSERT INTO rel_oper_menus (modulo, menu, secuencia, tipo_llamada, ejecuta_menu, ejecuta_operacion) 
SELECT 'F1', 50, IsNull(max(secuencia),0) + 1, 2, null, 'FCO5030' from rel_oper_menus WHERE modulo='F1' and menu = 50;

INSERT INTO rel_oper_modulos (operacion, modulo)  VALUES ('FCO5030','F1');

INSERT INTO aut_operaciones (usuario, operacion, nivel_seguridad) VALUES ('ADAM','FCO5030',4);
INSERT INTO aut_operaciones (usuario, operacion, nivel_seguridad)
SELECT usuario, 'FCO5030', nivel_seguridad FROM aut_operaciones  WHERE usuario <> 'ADAM' AND operacion = 'MF5040'
go

delete parametros_oper WHERE operacion IN ('MF0001', 'MF5040')
delete aut_operaciones WHERE operacion IN ('MF0001', 'MF5040')
delete rel_oper_menus WHERE ejecuta_operacion IN ('MF0001', 'MF5040')
delete rel_oper_modulos WHERE operacion IN ('MF0001', 'MF5040')
delete operaciones WHERE operacion IN ('MF0001', 'MF5040')
GO




