0
Completed

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.

Thanks.

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

\Source\Connector\Unify.IdentityBroker.Connector.Data\Resources\TruncatePartitionsCommandText.txt

Can this issue then be closed?

Thanks.

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.

Tony,

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

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

The command:

DBCC CHECKIDENT ('<name>', RESEED, 0)

Requires permissions which may cause problems later on with regards to clearing the table:
http://stackoverflow.com/questions/187920/dbcc-checkident-on-a-temporary-table-throwing-permissions-error-for-wrong-user

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

Reassigned for confirmation of correctness.