database - Delete all the records from a table -


how can delete records table in delphi? not allowed use loop this:

for k:=1 table1.recordcount     begin       table1.last;       table1.delete;     end; 

is there solutions?

the best way accomplish sql database perform delete directly on server, without moving client side cursor. way end issue several delete commands, 1 each record, when single delete command can delete records @ once.

even better, databases has truncate command (that's oracle, there can equivalent command other dbs) can empty whole table without generating rollback data, faster , requires less resources on server - long sure don't need rollback command later.

if database not sql database, documentation tell best way empty tables.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -