Script to remove a CI structure diagram

Version 1
    Question

    Script to remove a CI structure diagram

    Answer

    delete from cf_view_item

    delete from cf_view_group

    delete from cf_view_query

    delete from cf_view_relationship

    delete from cf_view where cf_title <> 'Total View'

     

    -- delete audit trail for all Config View classes

    delete from tps_audit_trail where tps_class_type_id in

         (select md_guid from md_class_type where md_client_class like 'Touchpaper.ClientClasses.ConfigManagement.View%')

    Environment

    Console ITBM.

     

    ***********************************************************

    This script be run by your database administrator and tested against a test copy of your database before applying live. When you apply to the live database, please ensure that no-one else is logged in and that a backup of the database has been taken. In the event of any problems you should restore from the backup copy.

     

    ***********************************************************