 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
RV Guest
|
Posted: Sat Jul 08, 2006 2:00 am Post subject: Performance problem |
|
|
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
|
Posted: Thu Jul 13, 2006 9:36 pm Post subject: Re: Performance problem |
|
|
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
|
Posted: Sun Jul 16, 2006 10:11 pm Post subject: Re: Performance problem |
|
|
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 |
|
 |
|
|
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
|
|