This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SOLUTION - PROGRAM MANAGEMENT - How to Delete part & documents

krish80 - Monday, November 23, 2009 2:28 AM:

Hi,

how to delete the parts & documents datas....

Thanks & Regards,

krish



tstickel - Monday, November 23, 2009 10:36 AM:

If you have not used the Innovator Change Management features (e.g. ECN, ECR) you may be able to clear out all existing parts using the following SQL statements via the SQL Server Management Studio.  I must warn you that I have used these SQL to clean out parts, but I can not guarentee that they will work as intended on your database.  So please make a backup of your database before trying these.

You must run these SQLs in order to remove Part data, completing each one before going to the next one:

SQL 1 is

delete from innovator.history
where source_id in (
select c.id from innovator.history_container c
where c.itemtype_id in (select i.id from innovator.itemtype i where i.keyed_name = 'Part'))

SQL 2 is

delete from innovator.part_goal
delete from innovator.part_document
delete from innovator.part_customer
delete from innovator.part_bom

SQL 3 is

delete from innovator.history_container
where itemtype_id in (select i.id from innovator.itemtype i where i.keyed_name = 'Part')

SQL 4 is

delete from innovator.part

You may be able to remove Documents using similar SQL statements.  The only delete in SQL 2 would be: "delete from innovator.document_file".  It would leave the File records in the Innovator DB.  But off-hand I am not sure what would be the best way to handle the vaulted files themselves.  So be careful messing with the vault.  Maybe someone else has tackled this problem for documents with files in the Vault.