Page 1 of 1

TMSTable->Delete() is very slow

Posted: Tue 23 Jun 2009 18:28
by sct_alan
TMSTable->Delete() is very slow.
Is there a faster way to delete rows?
This is what I’m currently doing (All rows in table are deleted) in C++.

if(!dmSCT->MSTable_Delete->Eof)
{
do
{
dmSCT->MSTable_Delete->Delete() ;
}while(!dmSCT->MSTable_Delete->Eof) ;
}

Alan

Posted: Wed 24 Jun 2009 06:44
by Dimon
To delete all rows from a table you can use the "TRUNCATE TABLE" SQL statement, like this:

Code: Select all

  MSQuery.SQL.Text := 'TRUNCATE TABLE tablename';
  MSQuery.Execute;