Thread View: borland.public.cppbuilder.database.ado
1 messages
1 total messages
Started by Zhan Weiming
Sat, 28 Jun 2008 14:33
SQL Server: Append / Post slow
Author: Zhan Weiming
Date: Sat, 28 Jun 2008 14:33
Date: Sat, 28 Jun 2008 14:33
67 lines
2760 bytes
2760 bytes
Hi there,
In my application, data are exported to database, in Access or SQLServer.
But it is found that the exporting speed to SQLServer is much slower than to
ACCESS. Using SQLServer, it takes about 100 seconds to write 50000 records,
while 2 seconds for ACCESS.
Here are the codes for SQLServer exporting:
/*
TADOTable * SQLServerTable;
*/
SQLServerTable->Active = false;
SQLServerTable->TableName = TableName;
SQLServerTable->Active = true;
for(int i=0;i<RECORDS_COUNT;++i)
{
//fill the record that is not empty, not exported, and not ongoing
SQLServerTable->Append();
//loop for write a record
while(!a_record_finish_exporting)
{
SQLServerTable->Fields->Fields[idx]->AsInteger = somevalue ;
}
SQLServerTable->Post();
}
And ACCESS Database exporting:
/*
TDAOTable *AccessTable;
//TDAOTable is a components to access Microsoft Access Database.
(Diamond Access)
*/
AccessTable->Active = false;
AccessTable->TableName = TableName;
AccessTable->Active = true;
for(int i=0;i<RECORDS_COUNT;++i)
{
//fill the record that is not empty, not exported, and not ongoing
AccessTable->Append();
//loop for write a record
while(!a_record_finish_exporting)
{
AccessTable->Fields->Fields[idx]->AsInteger = somevalue;
}
AccessTable->Post();
}
Any ideas are appreciated.
Thanks.
Zhan Weiming
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads