Se o banco em questão for MySQL, o segredo é fazer importação sob uma trasação, vai importar muuito rápido.
2009/6/26 Leandro <mutu...@yahoo.com.br> > > > isso soh eh possivel do a partir do mysql 5 n eh? > > 2009/6/26 Wilson, Stephen > <stephen.wil...@ipswichhospital.nhs.uk<stephen.wilson%40ipswichhospital.nhs.uk> > > > > > > > > > Bom dia, Fernando > > > > Poderia fazer isso em uma operacao, assim: > > > > Insert Into TabelaDestino(Campo1,ampo2,Campo3) Select > Campo1,Campo2,Campo3 > > From TabelaFonte ?? > > > > Sera muito rapido (menos que1 sec para 4000 registros em meus dados) - > > talvez demasiado rapido para mostrar progressao com um progressbar > > > > Atenciosamente > > Steve > > > > > > -----Original Message----- > > > > > > > > > > > > Opa, > > > > > > Sou iniciante em delphi, to com o seguinte problema: > > > > > > Tenho que importar dados de uma tabela para a outra, seus campos sao > > > iguais. > > > uso a seguinte logica: > > > > > > tenho duas querys no form, uma qry_fonte(de onde vou pegar os dados da > > > tabela que quero importar), e colocar na outra tabela que criei, na > > > qry_Destino. > > > > > > de primeiro, faco um select * pra pegar tds os campos da tabela fonte, > e > > > depois, faco um insert campo a campo na tabela de destino, ex: > > > > > > ---------------------------------------------------------- > > > QRY_Fonte.sql.Clear; > > > QRY_Fonte.SQL.Add('Select * From [TabelaFonte]'); > > > QRY_Fonte.Open; > > > while Not QRY_Fonte.Eof do > > > begin > > > with QRY_Destino do > > > begin > > > > > > sql.Clear; > > > Sql.Add('Insert Into [TabelaDestino] ('); > > > SQL.Add('campo1, campo2, campo3'); > > > SQL.Add(') Values ('); > > > SQL.Add(QuotedStr(QRY_Fonte.FieldByName('Campo1').AsString)+','); > > > SQL.Add(QuotedStr(QRY_Fonte.FieldByName('Campo2').AsString)+','); > > > SQL.Add(QuotedStr(QRY_Fonte.FieldByName('Campo3).AsString)+','); etc... > > > ExecSql; > > > ProgressBar1.Position := ProgressBar1.Position + 1; > > > Application.ProcessMessages; > > > QRY_Fonte.Next; > > > > > > end; > > > end; > > > qry_Fonte.close; > > > > > > ------------------------------------------------ > > > > > > Funciona, mais ta MUIITOO lento!!! > > > pra importar 150 reg de uma tabela pra outra demora um pouco mais de 1 > > > Minuto. > > > e tenho tabelas aqui com mais de 8.000. > > > > > > oq pode ta errado, e se alguem conhece uma forma melhor e mais rapida > de > > > manipular esses dados? > > > > > > Atenciosamente > > > Fernando Pires > > > > > > __________________________________________________________ > > > Conheça os novos produtos Windows Live! Clique aqui. > > > http://www.windowslive.com.br > > > > > > [As partes desta mensagem que não continham texto foram removidas] > > > > > > > > > > > > > -- > > ....................................................... > > Eduardo Silva dos Santos > > DRD SISTEMAS > > (27) 3218-4201 > > (27) 9961-7095 > > MSN: eduardo....@gmail.com <eduardo.drd%40gmail.com> <eduardo.drd% > 40gmail.com> > > Site: http://www.drdsistemas.com.br/ > > ....................................................... > > > > [As partes desta mensagem que não continham texto foram removidas] > > > > ------------------------------------ > > > > -- > > <<<<< FAVOR REMOVER ESTA PARTE AO RESPONDER ESTA MENSAGEM >>>>> > > > > > *************************************************************************** > > This e-mail and any files transmitted with it are confidential. If you > are > > not the intended recipient, any reading, printing, storage, disclosure, > > copying or any other action taken in respect of this e-mail is prohibited > > and may be unlawful. If you are not the intended recipient, please notify > > the sender immediately by using the reply function and then permanently > > delete what you have received. > > Content of emails received by this Trust will be subject to disclosure > > under the Freedom of Information Act 2000, subject to the specified > > exemptions, including the Data Protection Act 1998 and Caldicott Guardian > > principles. > > This footnote also confirms that, unless otherwise stated, this email > > message has been swept by Sophos Anti-virus for the presence of computer > > viruses. > > > *************************************************************************** > > > > > > > > -- > Leandro, MuTukA > > [As partes desta mensagem que não continham texto foram removidas] > > > -- ....................................................... Eduardo Silva dos Santos DRD SISTEMAS (27) 3218-4201 (27) 9961-7095 MSN: eduardo....@gmail.com Site: http://www.drdsistemas.com.br/ ....................................................... [As partes desta mensagem que não continham texto foram removidas]