Hi Thomas, >>> Hello, >>> >>> I would like to save the old records in a separate table every year. >>> On the >>> end of the year I would Copy the empty main-table to an new table >>> named like "Backup" and the old year for example. The new backup table >>> needs no triggers. >>> >>> How can I realize this? >>> >> What's the problem? >> >> Kjell >> > I would not use a text-based ddl-string, the main-table has many columns. Is > there a simple solution available? For example ""copy"" table etc.
>No direct DDL statement, but if this can involve user interaction via a >tool, use "Duplicate Table" in Database Workbench, but you know, I'm >biased. ;-) >Regards, >Thomas At the time I'm using a simple solution. There are two generators, one with the id (PK) and one counts the inserted date. If the second generator reached a count value, I move the old records in a backup-table like the year of creating. After this I reset the second generator. For creating the table I use at the time a simple statement-text (varchar(5000) with DDL) and execute this, without reading the system tables. It works but may not be the best solution. Thanks. [Non-text portions of this message have been removed]