Subject Truncate table
Author ck1625
Hi,

I need to clear some tables completely in a batch process. I know, the fastest would be to drop and recreate these tables. But to do this, I need to drop and recreate foreign keys as well.

I would like a "local" solution, this means to save all DDL information before dropping the table, then recreate it from there.

What is the best way to do that? Or is there another solution?

Right now I do
DELETE FROM <table>
SELECT * FROM <table>
I do it here, so that the time for the first SELECT is lost during deletion and not later when somebody does the first restart.

I work with Delphi / UniDac.

cu Christian