Home > Back-end >  Implement the synchronization between the database
Implement the synchronization between the database

Time:11-18

Database A table Table_A, thinking of Table_A content synchronization into the database table B Table_B, except with loop to Insert A detailed, if there is A way of batch write? For example:

Ado_A_query and ado_B_table through different connection to connect to the database A and B respectively, perform the following statement:

Ado_A_query. SQL. Text:='Select * From Table_A'
Ado_A_query. Open;

Ado_B_table. TableName:='Table_B';//Table_B is empty table, field definitions are in complete accord with Table_A
Ado_B_table. Active:=True;
Ado_B_table. You:=ado_A_query. You;
Ado_B_query. UpdateBatch (arall);

So that perform not an error, but Table_B empty table, please familiar with the great spirit of guidance,

CodePudding user response:

UpdateBatch only after record modified submitted back to the database, after you read the record actual has not been modified,
Actually a quick insert can, just wrapped in a transaction, performance than the default one insert a transaction is much higher,
The function of the database itself with Bulk commonly write, but can not use these functions, in ADO can try without the Delphi program to realize the database synchronization, directly with the database SQL script to do,

CodePudding user response:

Is the ACCESS, B is used

CodePudding user response:

Use Delphi to implement the data table synchronization is a method of efficiency is very poor, suggest using SQL server management studio provides data import function instead of
Sql Server also provides Integration Service, this is a more powerful, but also more complex, suitable for different types of import and export data between the database,

CodePudding user response:

Recommended BatchMove connecting two tables for data transfer,

CodePudding user response:

BatchMove is positive solutions, dedicated to do it
  • Related