🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #39

SQL Server: Append / Post slow

#39
From: Zhan Weiming
Date: Sat, 28 Jun 2008 14:33
67 lines
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

 
Technical Details
Message-ID: <48664bc3@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!194.109.133.81.MISMATCH!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!feeder.news-service.com!news.isoc.lu!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,bf1e18e2d0fa78d8,start
X-Google-Attributes: gid10698b,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Zhan Weiming" <zhanweiming@hotmail.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: SQL Server: Append / Post slow
Date: Sat, 28 Jun 2008 22:33:34 +0800
Lines: 1
MIME-Version: 1.0
Content-Type: text/plain;
 format=flowed;
 charset="gb2312";
 reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 12.0.1606
X-MimeOLE: Produced By Microsoft MimeOLE V12.0.1606
NNTP-Posting-Host: 116.7.106.219
Message-ID: <48664bc3@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1214663619 116.7.106.219 (28 Jun 2008 07:33:39 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!194.109.133.81.MISMATCH!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!feeder.news-service.com!news.isoc.lu!newsgroups.borland.com!not-for-mail