TMSTable->Delete() is very slow

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 2
Joined: Mon 18 Aug 2008 20:52
Location: NJ, USA

TMSTable->Delete() is very slow

Post by sct_alan » Tue 23 Jun 2009 18:28

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++.

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


Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 24 Jun 2009 06:44

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';

Post Reply