BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Performance problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
RV
Guest





PostPosted: Sat Jul 08, 2006 2:00 am    Post subject: Performance problem Reply with quote



I'm using BCB3 and I want to migrate paradox-tables to MS SQL Server 2000.

I created an ODBC-alias as link to the SQL Server.
I use the components TDatabase, TDataset, TTable from BCB3.

I display all rows of a table (20000 records) in a TDBGrid. The performance
of this process is optimal. However, when I try to insert 20000 records (or
update if the record exists) the performance is very low. I guess the
function GotoKey() slows the process. This is the code I use:

tbTable->SetKey();
tbTable->FieldByName( "Pkey" )->AsString = loPkey;
if( tbTable->GotoKey() )
{
tbTable->Edit();
}
else
{
tbTable->Insert();
}

I already used FindKey(), Locate() or a SQL Query (via TQuery) as an
alternative. But without result.
Someone got any ideas?

Kind Regards
Back to top
Pedro Fehlauer
Guest





PostPosted: Thu Jul 13, 2006 9:36 pm    Post subject: Re: Performance problem Reply with quote



Sure there is a problem! You shouldn't use TTable to acces SQL servers! The
performance is terrible.

I would suggest you to use directly the INSER INTO SQL statement.

What do you want to insert?

Pedro



"RV" <roosje.vuylsteke (AT) skynet (DOT) be> escribió en el mensaje
news:44aecb6f$1 (AT) newsgroups (DOT) borland.com...
Quote:
I'm using BCB3 and I want to migrate paradox-tables to MS SQL Server 2000.

I created an ODBC-alias as link to the SQL Server.
I use the components TDatabase, TDataset, TTable from BCB3.

I display all rows of a table (20000 records) in a TDBGrid. The
performance of this process is optimal. However, when I try to insert
20000 records (or update if the record exists) the performance is very
low. I guess the function GotoKey() slows the process. This is the code
I use:

tbTable->SetKey();
tbTable->FieldByName( "Pkey" )->AsString = loPkey;
if( tbTable->GotoKey() )
{
tbTable->Edit();
}
else
{
tbTable->Insert();
}

I already used FindKey(), Locate() or a SQL Query (via TQuery) as an
alternative. But without result.
Someone got any ideas?

Kind Regards
Back to top
RV
Guest





PostPosted: Sun Jul 16, 2006 10:11 pm    Post subject: Re: Performance problem Reply with quote



I want to insert/update customer information (addresses, emails,
birthdates,...).

When I use the INSERT-statement, how can I test if a customer already
exists? With the SELECT-statement before every INSERT or UPDATE, the
performance is also terrible...

Kind Regards,
Roosje
"Pedro Fehlauer" <info@sistemas-especificos.com> wrote in message
news:44b67695$1 (AT) newsgroups (DOT) borland.com...
Quote:
Sure there is a problem! You shouldn't use TTable to acces SQL servers!
The performance is terrible.

I would suggest you to use directly the INSER INTO SQL statement.

What do you want to insert?

Pedro



"RV" <roosje.vuylsteke (AT) skynet (DOT) be> escribió en el mensaje
news:44aecb6f$1 (AT) newsgroups (DOT) borland.com...
I'm using BCB3 and I want to migrate paradox-tables to MS SQL Server
2000.

I created an ODBC-alias as link to the SQL Server.
I use the components TDatabase, TDataset, TTable from BCB3.

I display all rows of a table (20000 records) in a TDBGrid. The
performance of this process is optimal. However, when I try to insert
20000 records (or update if the record exists) the performance is very
low. I guess the function GotoKey() slows the process. This is the code
I use:

tbTable->SetKey();
tbTable->FieldByName( "Pkey" )->AsString = loPkey;
if( tbTable->GotoKey() )
{
tbTable->Edit();
}
else
{
tbTable->Insert();
}

I already used FindKey(), Locate() or a SQL Query (via TQuery) as an
alternative. But without result.
Someone got any ideas?

Kind Regards


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.