delete from gva12 where t_comp = 'FAC' and n_comp = 'B003600012971'
Reemplazá el Número de Factura en todas las instrucciones.
delete from gva12de where t_comp = 'FAC' and n_comp = 'B003600012971'
delete from gva86 where t_comp = 'FAC' and n_comp = 'B003600012971'
delete from gva87 where t_comp = 'FAC' and n_comp = 'B003600012971'
delete from gva88 where t_comp = 'FAC' and n_comp = 'B003600012971'
delete from comprobante_cotizacion_sb where id_sba02 = (select id_sba02 from sba02 where cod_comp='FAC') and n_comp = 'B003600012971' or id_sba02 = (select id_sba02 from sba02 where cod_comp='REV') and n_comp = (select n_comp_rev from sba27 where t_comp_ori = 'FAC' and n_comp_ori = 'B003600012971' )
delete from sba04 where cod_comp = 'FAC' and n_comp = 'B003600012971' or cod_comp = 'REV' and n_comp = (select n_comp_rev from sba27 where t_comp_ori = 'FAC' and n_comp_ori = 'B003600012971' )
delete from sba05 where cod_comp = 'FAC' and n_comp = 'B003600012971' or cod_comp = 'REV' and n_comp = (select n_comp_rev from sba27 where t_comp_ori = 'FAC' and n_comp_ori = 'B003600012971' )
delete from sba27 where t_comp_ori = 'FAC' and n_comp_ori = 'B003600012971'
Quizás esté faltando alguna Tabla, lo estoy tratando en:
http://software.yoreparo.com/software_de_gestion/1628233.html
Saludos!