Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQL Server: Append / Post slow

5 views
Skip to first unread message

Zhan Weiming

unread,
Jun 28, 2008, 10:33:34 AM6/28/08
to
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

0 new messages