Create clear database script

Adam van Vliet 13 years ago updated by anonymous 9 years ago 7

From PRODUCT-14, the current clear database script is out of date and there isn't currently a script for v4.0.

Please change TruncatePartitionsCommandText to a .sql file and rename and move to the database directory.

Please add to the installer such that it is included like the other script.


Tony, is there a reason the following file is still in source control?


Can this issue then be closed?


A clear script has been introduced which removes the foreign keys of each table, and truncates them individually, bottom-up from the foreign key hierarchy. The keys are introduced on successful truncation.

TruncatePartitionContext.txt was an old resource used to truncate before the Clear database script was included and is no longer required - and has been removed.


Would it be worth resetting the identity columns in the script? From a suggestion from Richard:

DBCC CHECKIDENT ('table name', RESEED, 0)

The command:


Requires permissions which may cause problems later on with regards to clearing the table:

The mentioned potential script upgrade is not worth the risk of including additional requirements on use.

Reassigned for confirmation of correctness.