
-- =======================================================================
--   system database                                                      
-- =======================================================================
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'CFG_PROPS_2') AND type='U') DROP TABLE CFG_PROPS_2
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'GLOBAL_NLS_FONT_1') AND type='U') DROP TABLE GLOBAL_NLS_FONT_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'GLOBAL_NLS_FORMAT_1') AND type='U') DROP TABLE GLOBAL_NLS_FORMAT_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'GLOBAL_NLS_TEXT_1') AND type='U') DROP TABLE GLOBAL_NLS_TEXT_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'MEMBERS') AND type='U') DROP TABLE MEMBERS
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'RESOURCE_LOCK') AND type='U') DROP TABLE RESOURCE_LOCK
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'TBL_DUAL_JINFONET') AND type='U') DROP TABLE TBL_DUAL_JINFONET
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'TBL_IDGENRATOR_JINFONET') AND type='U') DROP TABLE TBL_IDGENRATOR_JINFONET
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'TBL_LOCK_JINFONET') AND type='U') DROP TABLE TBL_LOCK_JINFONET
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'UPDATEDETAILS_1') AND type='U') DROP TABLE UPDATEDETAILS_1
GO

-- =======================================================================
--   profile database                                                     
-- =======================================================================
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'RESOURCE_LOCK') AND type='U') DROP TABLE RESOURCE_LOCK
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'TASKAUDIT') AND type='U') DROP TABLE TASKAUDIT
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'TASKCONTEXT_2') AND type='U') DROP TABLE TASKCONTEXT_2
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'TBL_DUAL_JINFONET') AND type='U') DROP TABLE TBL_DUAL_JINFONET
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'TBL_IDGENRATOR_JINFONET') AND type='U') DROP TABLE TBL_IDGENRATOR_JINFONET
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'TBL_LOCK_JINFONET') AND type='U') DROP TABLE TBL_LOCK_JINFONET
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'UPDATEDETAILS_1') AND type='U') DROP TABLE UPDATEDETAILS_1
GO

-- =======================================================================
--   realm database                                                       
-- =======================================================================
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'ACLENTRIES_3') AND type='U') DROP TABLE ACLENTRIES_3
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'ACLS_2') AND type='U') DROP TABLE ACLS_2
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'ACLS_WITH_RESOURCE_1') AND type='U') DROP TABLE ACLS_WITH_RESOURCE_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'ALIASES_2') AND type='U') DROP TABLE ALIASES_2
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'ALIAS_MAPPING') AND type='U') DROP TABLE ALIAS_MAPPING
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'ALIAS_MAPPING_KEY') AND type='U') DROP TABLE ALIAS_MAPPING_KEY
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'CATALOGVERSION_4') AND type='U') DROP TABLE CATALOGVERSION_4
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'CFG_PROPS_2') AND type='U') DROP TABLE CFG_PROPS_2
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'COMPLETEDPUBLISHTABLE_2') AND type='U') DROP TABLE COMPLETEDPUBLISHTABLE_2
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'COMPLETEDRESULTTABLE_3') AND type='U') DROP TABLE COMPLETEDRESULTTABLE_3
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'COMPLETEDTABLE_4') AND type='U') DROP TABLE COMPLETEDTABLE_4
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'JR_QRTZ_TRIGGER_LISTENERS') AND type='U') DROP TABLE JR_QRTZ_TRIGGER_LISTENERS
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'JR_QRTZ_SIMPLE_TRIGGERS') AND type='U') DROP TABLE JR_QRTZ_SIMPLE_TRIGGERS
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'JR_QRTZ_JOB_LISTENERS') AND type='U') DROP TABLE JR_QRTZ_JOB_LISTENERS
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'JR_QRTZ_CRON_TRIGGERS') AND type='U') DROP TABLE JR_QRTZ_CRON_TRIGGERS
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'JR_QRTZ_BLOB_TRIGGERS') AND type='U') DROP TABLE JR_QRTZ_BLOB_TRIGGERS
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'JR_QRTZ_TRIGGERS') AND type='U') DROP TABLE JR_QRTZ_TRIGGERS
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'JR_QRTZ_JOB_DETAILS') AND type='U') DROP TABLE JR_QRTZ_JOB_DETAILS
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'DYN_BVELE_NAME_MAPPING_1') AND type='U') DROP TABLE DYN_BVELE_NAME_MAPPING_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'DYN_BVELE_NAME_1') AND type='U') DROP TABLE DYN_BVELE_NAME_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'DYNAMIC_CONNECTIONS_MAPPING_2') AND type='U') DROP TABLE DYNAMIC_CONNECTIONS_MAPPING_2
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'DYNAMIC_CONNECTIONS_2') AND type='U') DROP TABLE DYNAMIC_CONNECTIONS_2
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'DASHBOARDLISTENERTARGET_1') AND type='U') DROP TABLE DASHBOARDLISTENERTARGET_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'DASHBOARDLISTENER_1') AND type='U') DROP TABLE DASHBOARDLISTENER_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'CRD_CONN_INFO_1') AND type='U') DROP TABLE CRD_CONN_INFO_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'CRDRUNDETAIL_1') AND type='U') DROP TABLE CRDRUNDETAIL_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'CRD_INFO_5') AND type='U') DROP TABLE CRD_INFO_5
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'COMP_CRD_CONN_INFO_1') AND type='U') DROP TABLE COMP_CRD_CONN_INFO_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'COMPLETED_CRD_INFO_3') AND type='U') DROP TABLE COMPLETED_CRD_INFO_3
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'CUSTOM_FIELD_1') AND type='U') DROP TABLE CUSTOM_FIELD_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'CUSTOM_FIELD_VALUE_1') AND type='U') DROP TABLE CUSTOM_FIELD_VALUE_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'DRESULT_3') AND type='U') DROP TABLE DRESULT_3
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'DYNAMICNODE_5') AND type='U') DROP TABLE DYNAMICNODE_5
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'DYNAMICRESULT_2') AND type='U') DROP TABLE DYNAMICRESULT_2
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'DYN_SECURITY_1') AND type='U') DROP TABLE DYN_SECURITY_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'EXTENDACLENTRIES_3') AND type='U') DROP TABLE EXTENDACLENTRIES_3
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'FOLDERS_4') AND type='U') DROP TABLE FOLDERS_4
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'GROUPPROFILES_2') AND type='U') DROP TABLE GROUPPROFILES_2
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'GROUPS_3') AND type='U') DROP TABLE GROUPS_3
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'GUPROFILES_3') AND type='U') DROP TABLE GUPROFILES_3
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'HISTORY_PARAMLIST_TABLE_1') AND type='U') DROP TABLE HISTORY_PARAMLIST_TABLE_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'JR_QRTZ_CALENDARS') AND type='U') DROP TABLE JR_QRTZ_CALENDARS
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'JR_QRTZ_FIRED_TRIGGERS') AND type='U') DROP TABLE JR_QRTZ_FIRED_TRIGGERS
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'JR_QRTZ_LOCKS') AND type='U') DROP TABLE JR_QRTZ_LOCKS
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'JR_QRTZ_PAUSED_TRIGGER_GRPS') AND type='U') DROP TABLE JR_QRTZ_PAUSED_TRIGGER_GRPS
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'JR_QRTZ_SCHEDULER_STATE') AND type='U') DROP TABLE JR_QRTZ_SCHEDULER_STATE
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'LCVERSION_2') AND type='U') DROP TABLE LCVERSION_2
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'NODES_6') AND type='U') DROP TABLE NODES_6
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'ORGANIZATIONS_1') AND type='U') DROP TABLE ORGANIZATIONS_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'REPORTVERSION_4') AND type='U') DROP TABLE REPORTVERSION_4
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'RESOURCEMAP_2') AND type='U') DROP TABLE RESOURCEMAP_2
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'RESOURCENLS_1') AND type='U') DROP TABLE RESOURCENLS_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'RESOURCENODES_5') AND type='U') DROP TABLE RESOURCENODES_5
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'RESOURCE_LOCK') AND type='U') DROP TABLE RESOURCE_LOCK
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'RESULTVERSION_3') AND type='U') DROP TABLE RESULTVERSION_3
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'RESULT_3') AND type='U') DROP TABLE RESULT_3
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'RGPROFILES_2') AND type='U') DROP TABLE RGPROFILES_2
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'ROLEPROFILES_3') AND type='U') DROP TABLE ROLEPROFILES_3
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'ROLES_4') AND type='U') DROP TABLE ROLES_4
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'SCHDLASTEXETIME_1') AND type='U') DROP TABLE SCHDLASTEXETIME_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'STORAGE_MEMBER_1') AND type='U') DROP TABLE STORAGE_MEMBER_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'STORAGE_RESOURCE_1') AND type='U') DROP TABLE STORAGE_RESOURCE_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'TBL_DUAL_JINFONET') AND type='U') DROP TABLE TBL_DUAL_JINFONET
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'TBL_IDGENRATOR_JINFONET') AND type='U') DROP TABLE TBL_IDGENRATOR_JINFONET
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'TBL_LOCK_JINFONET') AND type='U') DROP TABLE TBL_LOCK_JINFONET
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'TRIGGERS_1') AND type='U') DROP TABLE TRIGGERS_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'UPDATEDETAILS_1') AND type='U') DROP TABLE UPDATEDETAILS_1
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'USERPROFILES_4') AND type='U') DROP TABLE USERPROFILES_4
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'USERS_4') AND type='U') DROP TABLE USERS_4
GO
IF EXISTS (SELECT 1 FROM sysobjects WHERE id=OBJECT_ID(N'VERSIONNODES_3') AND type='U') DROP TABLE VERSIONNODES_3
GO
