insert into REGRASTRIBUTARIAS.dbo.tblLUCROREALRESTAURANTE
(NCM_NFE,Origem,Cfop,TaxaTributaria,Icmf,SubstTributaria,CSOSN,Cest,RegraCalculo,Cst_Confins,Cst_Icms,CST_NFE,
Cst_pis,Aliq_Confins,Aliq_ecf,Aliq_icms_iss,Aliq_pis,Reducao_bc_icms) 
select  NCM_NFE,Origem,Cfop,TaxaTributaria,Icmf,SubstTributaria,CSOSN,Cest,RegraCalculo,Cst_Confins,Cst_Icms,CST_NFE,
Cst_pis,Aliq_Confins,Aliq_ecf,Aliq_icms_iss,Aliq_pis,Reducao_bc_icms from DAITAN.dbo.tblproduto 
group by NCM_NFE,Origem,Cfop,TaxaTributaria,Icmf,SubstTributaria,CSOSN,Cest,RegraCalculo,Cst_Confins,Cst_Icms,CST_NFE,
Cst_pis,Aliq_Confins,Aliq_ecf,Aliq_icms_iss,Aliq_pis,Reducao_bc_icms

select*From REGRASTRIBUTARIAS.dbo.tblLUCROREALRESTAURANTE

delete from REGRASTRIBUTARIAS.dbo.tblLUCROREALRESTAURANTE where ncm_nfe = ''
