Error 100377: SQL server not connected.
drop table if exists aa;
Error 100377: SQL server not connected.
create table aa select serdoc,no_doc,d_lan,prazo,date(AddDate(d_lan,interval prazo day)) as d1,   date(now()) as agora,date(AddDate(d_lan,interval 1 month )) as d3 FROM  documento_d0 a where prazo>0 and day(d_lan)>0 and convertido<no_banco 
Error 100377: SQL server not connected.
update aa set d3=NULL;
Error 100377: SQL server not connected.
update aa set d3=AddDate(d_lan,interval 1 month ) where prazo=30;
Error 100377: SQL server not connected.
update aa set d3=AddDate(d_lan,interval 1 month ) where prazo=31;
Error 100377: SQL server not connected.
update aa set d3=AddDate(d_lan,interval 2 month ) where prazo=60;
Error 100377: SQL server not connected.
update aa set d3=AddDate(d_lan,interval 3 month ) where prazo=90;
Error 100377: SQL server not connected.
update aa set d3=AddDate(d_lan,interval 1 year ) where prazo=365;
Error 100377: SQL server not connected.
update aa set d3=d1 where d3 is null;
Error 100377: SQL server not connected.
update aa set d3=d1 where d1<d3
Error 100377: SQL server not connected.
drop table if exists aa;
Error 100377: SQL server not connected.
create table aa select serdoc,no_doc,d_lan,prazo,date(AddDate(d_lan,interval prazo day)) as d1,   date(now()) as agora,date(AddDate(d_lan,interval 1 month )) as d3 FROM  documento_d0 a where prazo>0 and day(d_lan)>0 and convertido<no_banco 
Error 100377: SQL server not connected.
update aa set d3=NULL;
Error 100377: SQL server not connected.
update aa set d3=AddDate(d_lan,interval 1 month ) where prazo=30;
Error 100377: SQL server not connected.
update aa set d3=AddDate(d_lan,interval 1 month ) where prazo=31;
Error 100377: SQL server not connected.
update aa set d3=AddDate(d_lan,interval 2 month ) where prazo=60;
Error 100377: SQL server not connected.
update aa set d3=AddDate(d_lan,interval 3 month ) where prazo=90;
Error 100377: SQL server not connected.
update aa set d3=AddDate(d_lan,interval 1 year ) where prazo=365;
Error 100377: SQL server not connected.
update aa set d3=d1 where d3 is null;
Error 100377: SQL server not connected.
update aa set d3=d1 where d1<d3
Entrada duplicada '2022-15' para la clave 2
UPDATE documento_d2 SET linhas=0,no_doc=15,emitido=0,anulado='',no_moed=0,convertido=0,referencia='',d_doc=20220118000000,d_venc=20220118000000,h_doc=20000101163000,no_cf=37,nome_cf='FRANCISCO TFT 14',desconto=0.0000,linha_pre=0,observacao='',no_operador=1,no_vended=0,comissao=0.0000,n_cond_pag=0,cond_pagam='',prazo=0,num_fp=0,des_fp='',com_fp='',no_banco=0,nome_banco='',tot_material=0.0100,tot_desconto=0.0000,tot_liquido=0.0100,tot_iva=0.0000,tot_valor=0.0100,val_pago=5.0000,val_pend=-4.9900,suj_valor0=0.0100,suj_valor1=0.0000,suj_valor2=0.0000,suj_valor3=0.0000,suj_taxa0=0.0000,suj_taxa1=13.0000,suj_taxa2=6.0000,suj_taxa3=23.0000,suj_iva0=0.0000,suj_iva1=0.0000,suj_iva2=0.0000,suj_iva3=0.0000,tdc=0,estado='',d_lan=00000000000000,moeda='',cambio=1.0000000,doc_mov_c='',lnhs_pgm=0,recebido=0.0000,bruto=0.0000,irs=0.0000,morada=0,custos=0.0000,serdoc='2022',tpdoc=0,ivac=0,rsv='' WHERE IDX=325 LIMIT 1;
Entrada duplicada '86' para la clave 2
UPDATE artigos SET lnh_des=0,lnh_arm=0,lnh_cmp=0,lnh_equ=0,codigo='86',codigo2='86',designacao_1='TINT. HP 302 P XL REC.',designacao_2='',abvr='',no_un_=0,unidade='',armazem='',familia='2',ultimo_custo=0.0000000,custo_medio=0.0000000,valor_medio=0.0000000,no_iva=1,iva=0.00,marg_1=0.0000000,marg_2=0.0000000,prc_s_iva_1=11.0000000,prc_s_iva_2=0.0000000,prc_c_iva_1=11.0000000,prc_c_iva_2=0.0000000,stock_minimo=0.000,stock=-1.000,stock_maximo=0.000,no_forn=0,d_entrada=00000000000000,d_saida=20220914000000,baixa='S',lnh_obs='',stock2=0.0000,lnh_emb='',lnh_prom='',flg=0,anos_ga=0,local_imp=0,usaserie='N',miva=0,rsv='',marg_3=-1.#QNAN00,prc_s_iva_3='0',prc_c_iva_3='0',marg_4='0',prc_s_iva_4='0',prc_c_iva_4='0',peso='' WHERE IDX=110 LIMIT 1;
Entrada duplicada 'C-D-1' para la clave 2
INSERT INTO doc_serie (serdoc,docmov,numero,nome,tp_doc,serie,tiposerie,classedoc,tipodoc,numinicial,datainicio,ultdoc,meioproc,numcert,codigoat,datareg,estado,motivo,justif,dataestado,nifcom) VALUES('C','D','1','','','D1-C','N','SI','FT','1','2023-01-01','','PI','1073','JFF4ZKRN','','A','','','','') 
Entrada duplicada '2022-D-13' para la clave 2
INSERT INTO doc_serie (serdoc,docmov,numero,nome,tp_doc,serie,tiposerie,classedoc,tipodoc,numinicial,datainicio,ultdoc,meioproc,numcert,codigoat,datareg,estado,motivo,justif,dataestado,nifcom) VALUES('2022','D','13','','','D13-2022','N','MG','GT','5','2022-11-19','','PI','1073','JF67TGSM','','A','','','','') 
Entrada duplicada '2022-D-7' para la clave 2
INSERT INTO doc_serie (serdoc,docmov,numero,nome,tp_doc,serie,tiposerie,classedoc,tipodoc,numinicial,datainicio,ultdoc,meioproc,numcert,codigoat,datareg,estado,motivo,justif,dataestado,nifcom) VALUES('2022','D','7','','','D7-2022','N','MG','GT','5','2022-11-19','','PI','1073','JF6FTGSP','','A','','','','') 
Entrada duplicada '2022-D-3' para la clave 2
INSERT INTO doc_serie (serdoc,docmov,numero,nome,tp_doc,serie,tiposerie,classedoc,tipodoc,numinicial,datainicio,ultdoc,meioproc,numcert,codigoat,datareg,estado,motivo,justif,dataestado,nifcom) VALUES('2022','D','3','','','D3-2022','N','SI','NC','1','2022-11-19','','PI','1073','JF6HTGSN','','A','','','','') 
Entrada duplicada '2022-D-2' para la clave 2
INSERT INTO doc_serie (serdoc,docmov,numero,nome,tp_doc,serie,tiposerie,classedoc,tipodoc,numinicial,datainicio,ultdoc,meioproc,numcert,codigoat,datareg,estado,motivo,justif,dataestado,nifcom) VALUES('2022','D','2','','','D2-2022','N','SI','FT','88','2022-11-19','','PI','1073','JF6JTGMP','','A','','','','') 
Entrada duplicada '2022-D-1' para la clave 2
INSERT INTO doc_serie (serdoc,docmov,numero,nome,tp_doc,serie,tiposerie,classedoc,tipodoc,numinicial,datainicio,ultdoc,meioproc,numcert,codigoat,datareg,estado,motivo,justif,dataestado,nifcom) VALUES('2022','D','1','','','D1-2022','N','SI','FT','5','2022-11-19','','PI','1073','JF65TGMG','','A','','','','') 
Entrada duplicada 'C-D-1' para la clave 2
INSERT INTO doc_serie (serdoc,docmov,numero,nome,tp_doc,serie,tiposerie,classedoc,tipodoc,numinicial,datainicio,ultdoc,meioproc,numcert,codigoat,datareg,estado,motivo,justif,dataestado,nifcom) VALUES('C','D','1','','','D1-C','N','SI','FT','1','2023-01-01','','PI','1073','JFF4ZKRN','','A','','','','') 
Entrada duplicada '2022-19' para la clave 2
UPDATE documento_d1 SET linhas=0,no_doc=19,emitido=1,anulado='',no_moed=0,convertido=0,referencia='',d_doc=20230228000000,d_venc=20230228000000,h_doc=20000101180200,no_cf=11,nome_cf='SECTORDIGITAL',desconto=0.0000,linha_pre=0,observacao='',no_operador=1,no_vended=0,comissao=0.0000,n_cond_pag=1,cond_pagam='P.PAGAMENTO',prazo=0,num_fp=0,des_fp='',com_fp='',no_banco=0,nome_banco='',tot_material=50.0000,tot_desconto=0.0000,tot_liquido=50.0000,tot_iva=0.0000,tot_valor=50.0000,val_pago=0.0000,val_pend=50.0000,suj_valor0=50.0000,suj_valor1=0.0000,suj_valor2=0.0000,suj_valor3=0.0000,suj_taxa0=0.0000,suj_taxa1=13.0000,suj_taxa2=6.0000,suj_taxa3=23.0000,suj_iva0=0.0000,suj_iva1=0.0000,suj_iva2=0.0000,suj_iva3=0.0000,tdc=0,estado='',d_lan=00000000000000,moeda='',cambio=1.0000000,doc_mov_c='',lnhs_pgm=0,recebido=0.0000,bruto=0.0000,irs=0.0000,morada=0,custos=0.0000,serdoc='2022',tpdoc=1,ivac=0,rsv='' WHERE IDX=31 LIMIT 1;
Tabla 'emp0002.caja' no existe
SELECT idx,fecha,concepto,entrada,salida,0 from caja where z=0 ORDER by idx;
Tabla 'emp0002.caja' no existe
SELECT idx,fecha,concepto,entrada,salida,0 from caja where z=0 ORDER by idx;
Tabla 'emp0002.caja' no existe
SELECT idx,fecha,concepto,entrada,salida,0 from caja where z=0 ORDER by idx;
Algo está equivocado en su sintax cerca 'char(30)' en la linea 1
ALTER TABLE documento_d2 ADD COLUMN  char(30)
Nombre de columna duplicado 'teste'
ALTER TABLE documento_d2 ADD COLUMN teste char(10)
Nombre de columna duplicado 'teste'
ALTER TABLE fornecedores ADD COLUMN teste int
Entrada duplicada '100' para la clave 2
INSERT INTO artigos (idx,lnh_des,lnh_arm,lnh_cmp,lnh_equ,codigo,codigo2,designacao_1,designacao_2,abvr,no_un_,unidade,armazem,familia,ultimo_custo,custo_medio,valor_medio,no_iva,iva,marg_1,marg_2,prc_s_iva_1,prc_s_iva_2,prc_c_iva_1,prc_c_iva_2,stock_minimo,stock,stock_maximo,no_forn,d_entrada,d_saida,baixa,lnh_obs,stock2,lnh_emb,lnh_prom,flg,anos_ga,local_imp,usaserie,miva,rsv,marg_3,prc_s_iva_3,prc_c_iva_3,marg_4,prc_s_iva_4,prc_c_iva_4,peso) VALUES(NULL,0,0,0,0,'100','100','OFF 21','','',0,'','','1',0.0000000,0.0000000,0.0000000,1,0.00,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.000,0.000,0.000,0,00000000000000,00000000000000,'S','',0.0000,'','',0,0,0,'N',0,'',0.0000000,'0.00','0.00','','0.00','0.00','');
Campo 'teste' especificado dos veces
INSERT INTO fornecedores (idx,lnhcco,lnhcnt,lnhart,lnhcmp,numero,nome_1,nome_2,morada,localidade,cod_post,concelho,distrito,zona,n_pais,pais,contribuinte,telefone,fax,n_cp,c_pagamento,prazo,desconto,linha_precos,n_bnc,email,conta,n_vendedor,vendedor,comissao,ppz,saldo0,saldo1,obs,dsc_linha,plafont,no_classe,des_classe,lim_cred,data,miva,venc,rsv,teste,teste1,teste) VALUES(NULL,0,0,0,0,13,'','','','','','','','',0,'','','','',0,'',0,0.00,0,0,'','',0,'',0.00,'',0.00,0.00,'',0.00,0.00,0,'',0,00000000000000,0,0,'','','','');
Campo 'teste' especificado dos veces
INSERT INTO fornecedores (idx,lnhcco,lnhcnt,lnhart,lnhcmp,numero,nome_1,nome_2,morada,localidade,cod_post,concelho,distrito,zona,n_pais,pais,contribuinte,telefone,fax,n_cp,c_pagamento,prazo,desconto,linha_precos,n_bnc,email,conta,n_vendedor,vendedor,comissao,ppz,saldo0,saldo1,obs,dsc_linha,plafont,no_classe,des_classe,lim_cred,data,miva,venc,rsv,teste,teste1,teste) VALUES(NULL,0,0,0,0,13,'','','','','','','','',0,'','','','',0,'',0,0.00,0,0,'','',0,'',0.00,'',0.00,0.00,'',0.00,0.00,0,'',0,00000000000000,0,0,'','','','');
Entrada duplicada '' para la clave 2
INSERT INTO artigos (idx,lnh_des,lnh_arm,lnh_cmp,lnh_equ,codigo,codigo2,designacao_1,designacao_2,abvr,no_un_,unidade,armazem,familia,ultimo_custo,custo_medio,valor_medio,no_iva,iva,marg_1,marg_2,prc_s_iva_1,prc_s_iva_2,prc_c_iva_1,prc_c_iva_2,stock_minimo,stock,stock_maximo,no_forn,d_entrada,d_saida,baixa,lnh_obs,stock2,lnh_emb,lnh_prom,flg,anos_ga,local_imp,usaserie,miva,rsv,marg_3,prc_s_iva_3,prc_c_iva_3,marg_4,prc_s_iva_4,prc_c_iva_4,peso) VALUES(NULL,0,0,0,0,'','','','','',0,'','','',0.0000000,0.0000000,0.0000000,0,0.00,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.000,0.000,0.000,0,00000000000000,00000000000000,'S','',0.0000,'','',0,0,0,'N',0,'',0.0000000,'','0.00','0.00','0.00','0.00','');
Campo 'teste' especificado dos veces
INSERT INTO fornecedores (idx,lnhcco,lnhcnt,lnhart,lnhcmp,numero,nome_1,nome_2,morada,localidade,cod_post,concelho,distrito,zona,n_pais,pais,contribuinte,telefone,fax,n_cp,c_pagamento,prazo,desconto,linha_precos,n_bnc,email,conta,n_vendedor,vendedor,comissao,ppz,saldo0,saldo1,obs,dsc_linha,plafont,no_classe,des_classe,lim_cred,data,miva,venc,rsv,teste,teste1,teste) VALUES(NULL,0,0,0,0,14,'','','','','','','','',0,'','','','',0,'',0,0.00,0,0,'','',0,'',0.00,'',0.00,0.00,'',0.00,0.00,0,'',0,00000000000000,0,0,'','','','');
Error on delete of 'C:\Users\Casa\OneDrive\LOJA\soft_tri\FTGEST\dados\emp0002\tmp.MYI' (Errcode: 2)
DROP TABLE IF EXISTS tmp
s b left join  Documento_D1 as a ON (b.num_doc=a.no_doc and a.serdoc=b.serdoc)   WHERE a.d_doc>=20240126 AND length(b.codigo)>0 AND a.anulado<>'S' AND a.serdoc='2022' AND a.d_doc<=20240126 GROUP BY codigo
Nombre de clave duplicado 'tmp_i'
CREATE INDEX tmp_i ON TMP(codigo);
Error on delete of 'C:\Users\Casa\OneDrive\LOJA\soft_tri\FTGEST\dados\emp0002\tmp2.MYI' (Errcode: 13)
DROP TABLE IF EXISTS tmp2
La tabla  'tmp2' ya existe
CREATE TABLE tmp2 ( codigo char(30),qtd  double  );
Nombre de clave duplicado 'tmp2_i'
CREATE INDEX tmp2_i ON TMP2(codigo);
Error on delete of 'C:\Users\Casa\OneDrive\LOJA\soft_tri\FTGEST\dados\emp0002\tmp3.MYI' (Errcode: 13)
DROP TABLE IF EXISTS tmp3
La tabla  'tmp3' ya existe
CREATE TABLE tmp3 ( codigo char(30),qtd  double  );
Entrada duplicada '2022-366' para la clave 2
UPDATE documento_d2 SET linhas=0,no_doc=366,emitido=0,anulado='',no_moed=0,convertido=0,referencia='',d_doc=20240216000000,d_venc=20240216000000,h_doc=20000101100100,no_cf=171,nome_cf='cab. conceicao viz',desconto=0.0000,linha_pre=0,observacao='',no_operador=1,no_vended=0,comissao=0.0000,n_cond_pag=0,cond_pagam='',prazo=0,num_fp=0,des_fp='',com_fp='',no_banco=0,nome_banco='',tot_material=0.0000,tot_desconto=0.0000,tot_liquido=0.0000,tot_iva=0.0000,tot_valor=0.0000,val_pago=8.0000,val_pend=-8.0000,suj_valor0=0.0000,suj_valor1=0.0000,suj_valor2=0.0000,suj_valor3=0.0000,suj_taxa0=0.0000,suj_taxa1=13.0000,suj_taxa2=6.0000,suj_taxa3=23.0000,suj_iva0=0.0000,suj_iva1=0.0000,suj_iva2=0.0000,suj_iva3=0.0000,tdc=0,estado='',d_lan=NULL,moeda='',cambio=1.0000000,doc_mov_c='',lnhs_pgm=0,recebido=0.0000,bruto=0.0000,irs=0.0000,morada=0,custos=0.0000,serdoc='2022',tpdoc=2,ivac=0,rsv='' WHERE IDX=638 LIMIT 1;
Campo 'teste' especificado dos veces
INSERT INTO fornecedores (idx,lnhcco,lnhcnt,lnhart,lnhcmp,numero,nome_1,nome_2,morada,localidade,cod_post,concelho,distrito,zona,n_pais,pais,contribuinte,telefone,fax,n_cp,c_pagamento,prazo,desconto,linha_precos,n_bnc,email,conta,n_vendedor,vendedor,comissao,ppz,saldo0,saldo1,obs,dsc_linha,plafont,no_classe,des_classe,lim_cred,data,miva,venc,rsv,teste,teste1,teste) VALUES(NULL,0,0,0,0,0,'','','','','','','','',0,'','','','',0,'',0,0.00,0,0,'','',0,'',0.00,'',0.00,0.00,'',0.00,0.00,0,'',0,NULL,0,0,'','','','');
