/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_constraint.sql **/
EXEC p_DropIdx 'IDX_BCM_DIM_L', 'T_BCM_DIMENSION_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_DIM_L') CREATE INDEX IDX_BCM_DIM_L ON T_BCM_DIMENSION_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_DIM_L_FNAMEFID') CREATE INDEX IDX_BCM_DIM_L_FNAMEFID ON T_BCM_DIMENSION_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_BIZRULE_L', 'T_BCM_BIZRULE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_BIZRULE_L') CREATE INDEX IDX_BCM_BIZRULE_L ON T_BCM_BIZRULE_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_BRC_L', 'T_BCM_BIZRULECATALOG_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_BRC_L') CREATE INDEX IDX_BCM_BRC_L ON T_BCM_BIZRULECATALOG_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_BIZRULEVER_L', 'T_BCM_BIZRULEVERSION_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_BIZRULEVER_L') CREATE INDEX IDX_BCM_BIZRULEVER_L ON T_BCM_BIZRULEVERSION_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_CheckTmpl_L_Tmpl', 'T_BCM_CHECKTMPL_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_CHECKTMPL_L_TMPL') CREATE INDEX IDX_BCM_CHECKTMPL_L_TMPL ON T_BCM_CHECKTMPL_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_CHECKTMPL_L_FNAMEFID') CREATE INDEX IDX_BCM_CHECKTMPL_L_FNAMEFID ON T_BCM_CHECKTMPL_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_RPTADJUSTQUERY_L', 'T_BCM_RPTADJUSTQUERYPLAN_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_RPTADJUSTQUERY_L') CREATE INDEX IDX_BCM_RPTADJUSTQUERY_L ON T_BCM_RPTADJUSTQUERYPLAN_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_CATALOG_lL_NUMMODID', 'T_BCM_TEMPLATECATALOG_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_CATALOG_LL_NUMMODID') CREATE INDEX IDX_BCM_CATALOG_LL_NUMMODID ON T_BCM_TEMPLATECATALOG_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_MODEL_L', 'T_BCM_MODEL_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_MODEL_L') CREATE INDEX IDX_BCM_MODEL_L ON T_BCM_MODEL_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_NOFINANCIALFILE_FID', 'T_BCM_NOFINANCIALFILE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_NOFINANCIALFILE_FID') CREATE INDEX IDX_NOFINANCIALFILE_FID ON T_BCM_NOFINANCIALFILE_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_MODELPERM_L', 'T_BCM_MODELPERM_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_MODELPERM_L') CREATE INDEX IDX_BCM_MODELPERM_L ON T_BCM_MODELPERM_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'Index_bcm_adjust', 'T_BCM_RPTADJUST_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INDEX_BCM_ADJUST') CREATE INDEX INDEX_BCM_ADJUST ON T_BCM_RPTADJUST_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_TASKCON_L', 'T_BCM_TASKCONF_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_TASKCON_L') CREATE INDEX IDX_BCM_TASKCON_L ON T_BCM_TASKCONF_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_TASKCATALOG_ID', 'T_BCM_TASKCATALOG_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_TASKCATALOG_ID') CREATE INDEX IDX_BCM_TASKCATALOG_ID ON T_BCM_TASKCATALOG_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_CHECKRECORD_L_FID', 'T_BCM_CHECKRECORD_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_CHECKRECORD_L_FID') CREATE INDEX IDX_BCM_CHECKRECORD_L_FID ON T_BCM_CHECKRECORD_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_ENTM_L', 'T_BCM_MEMBOFENT_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ENTM_L') CREATE INDEX IDX_BCM_ENTM_L ON T_BCM_MEMBOFENT_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_ICM_L', 'T_BCM_MEMBOFICENTITY_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ICM_L') CREATE INDEX IDX_BCM_ICM_L ON T_BCM_MEMBOFICENTITY_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_ENT_L', 'T_BCM_STRUCTOFENT_L';
EXEC p_DropIdx 'IDX_BCM_ENT_L_NAME', 'T_BCM_STRUCTOFENT_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ENT_L') CREATE INDEX IDX_BCM_ENT_L ON T_BCM_STRUCTOFENT_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ENT_L_NAME') CREATE INDEX IDX_BCM_ENT_L_NAME ON T_BCM_STRUCTOFENT_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_ICE_L', 'T_BCM_STRUCTOFICENTITY_L';
EXEC p_DropIdx 'IDX_BCM_ICE_L_NAME', 'T_BCM_STRUCTOFICENTITY_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ICE_L') CREATE INDEX IDX_BCM_ICE_L ON T_BCM_STRUCTOFICENTITY_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ICE_L_NAME') CREATE INDEX IDX_BCM_ICE_L_NAME ON T_BCM_STRUCTOFICENTITY_L ( FNAME ,FID );

EXEC p_DropIdx 'T_BCM_CHKFROMULA_L_FID', 'T_BCM_CHKFORMULASETTING_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_CHKFROMULA_L_FID') CREATE INDEX T_BCM_CHKFROMULA_L_FID ON T_BCM_CHKFORMULASETTING_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_CHKFROMULA_L_FNAMEFID') CREATE INDEX IDX_BCM_CHKFROMULA_L_FNAMEFID ON T_BCM_CHKFORMULASETTING_L ( FNAME ,FID );

EXEC p_DropIdx 'T_BCM_SchemeCatalog_l_FID', 'T_BCM_SCHEMECATALOG_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_SCHEMECATALOG_L_FID') CREATE INDEX T_BCM_SCHEMECATALOG_L_FID ON T_BCM_SCHEMECATALOG_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'T_BCM_SrcdimBasedata_l_FID', 'T_BCM_SRCDIMBASEDATA_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_SRCDIMBASEDATA_L_FID') CREATE INDEX T_BCM_SRCDIMBASEDATA_L_FID ON T_BCM_SRCDIMBASEDATA_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'T_BCM_ISBaseEntList_l_FID', 'T_BCM_ISBASEENTLIST_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISBASEENTLIST_L_FID') CREATE INDEX T_BCM_ISBASEENTLIST_L_FID ON T_BCM_ISBASEENTLIST_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISBASEENTLIST_L_FNAMEFID') CREATE INDEX T_BCM_ISBASEENTLIST_L_FNAMEFID ON T_BCM_ISBASEENTLIST_L ( FNAME ,FID );

EXEC p_DropIdx 'T_BCM_ISDimMap_l_FID', 'T_BCM_ISDIMMAP_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISDIMMAP_L_FID') CREATE INDEX T_BCM_ISDIMMAP_L_FID ON T_BCM_ISDIMMAP_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISDIMMAP_L_FNAMEFID') CREATE INDEX T_BCM_ISDIMMAP_L_FNAMEFID ON T_BCM_ISDIMMAP_L ( FNAME ,FID );

EXEC p_DropIdx 'T_BCM_ISProduct_l_FID', 'T_BCM_ISPRODUCT_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISPRODUCT_L_FID') CREATE INDEX T_BCM_ISPRODUCT_L_FID ON T_BCM_ISPRODUCT_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISPRODUCT_L_FNAMEFID') CREATE INDEX T_BCM_ISPRODUCT_L_FNAMEFID ON T_BCM_ISPRODUCT_L ( FNAME ,FID );

EXEC p_DropIdx 'T_BCM_ISScheme_l_FID', 'T_BCM_ISSCHEME_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISSCHEME_L_FID') CREATE INDEX T_BCM_ISSCHEME_L_FID ON T_BCM_ISSCHEME_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISSCHEME_L_FNAMEFID') CREATE INDEX T_BCM_ISSCHEME_L_FNAMEFID ON T_BCM_ISSCHEME_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_FY_L', 'T_BCM_STRUCTOFFY_L';
EXEC p_DropIdx 'IDX_BCM_FY_L_NAME', 'T_BCM_STRUCTOFFY_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_FY_L') CREATE INDEX IDX_BCM_FY_L ON T_BCM_STRUCTOFFY_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_FY_L_NAME') CREATE INDEX IDX_BCM_FY_L_NAME ON T_BCM_STRUCTOFFY_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_BP_L', 'T_BCM_STRUCTOFPROCESS_L';
EXEC p_DropIdx 'IDX_BCM_BP_L_NAME', 'T_BCM_STRUCTOFPROCESS_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_BP_L') CREATE INDEX IDX_BCM_BP_L ON T_BCM_STRUCTOFPROCESS_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_BP_L_NAME') CREATE INDEX IDX_BCM_BP_L_NAME ON T_BCM_STRUCTOFPROCESS_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_CT_L', 'T_BCM_STRUCTOFCHANGETYPE_L';
EXEC p_DropIdx 'IDX_BCM_CT_L_NAME', 'T_BCM_STRUCTOFCHANGETYPE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_CT_L') CREATE INDEX IDX_BCM_CT_L ON T_BCM_STRUCTOFCHANGETYPE_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_CT_L_NAME') CREATE INDEX IDX_BCM_CT_L_NAME ON T_BCM_STRUCTOFCHANGETYPE_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_RULE_L', 'T_BCM_STRUCTOFRULE_L';
EXEC p_DropIdx 'IDX_BCM_RULE_L_NAME', 'T_BCM_STRUCTOFRULE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_RULE_L') CREATE INDEX IDX_BCM_RULE_L ON T_BCM_STRUCTOFRULE_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_RULE_L_NAME') CREATE INDEX IDX_BCM_RULE_L_NAME ON T_BCM_STRUCTOFRULE_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_AT_L', 'T_BCM_STRUCTOFAUDITTRIAL_L';
EXEC p_DropIdx 'IDX_BCM_AT_L_NAME', 'T_BCM_STRUCTOFAUDITTRIAL_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_AT_L') CREATE INDEX IDX_BCM_AT_L ON T_BCM_STRUCTOFAUDITTRIAL_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_AT_L_NAME') CREATE INDEX IDX_BCM_AT_L_NAME ON T_BCM_STRUCTOFAUDITTRIAL_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_SCENE_L', 'T_BCM_STRUCTOFSCENE_L';
EXEC p_DropIdx 'IDX_BCM_SCENE_L_NAME', 'T_BCM_STRUCTOFSCENE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_SCENE_L') CREATE INDEX IDX_BCM_SCENE_L ON T_BCM_STRUCTOFSCENE_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_SCENE_L_NAME') CREATE INDEX IDX_BCM_SCENE_L_NAME ON T_BCM_STRUCTOFSCENE_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_CURRENCY_L', 'T_BCM_STRUCTOFCURRENCY_L';
EXEC p_DropIdx 'IDX_BCM_CURRENCY_L_NAME', 'T_BCM_STRUCTOFCURRENCY_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_CURRENCY_L') CREATE INDEX IDX_BCM_CURRENCY_L ON T_BCM_STRUCTOFCURRENCY_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_CURRENCY_L_NAME') CREATE INDEX IDX_BCM_CURRENCY_L_NAME ON T_BCM_STRUCTOFCURRENCY_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_PREIOD_L', 'T_BCM_STRUCTOFPERIOD_L';
EXEC p_DropIdx 'IDX_BCM_PREIOD_L_NAME', 'T_BCM_STRUCTOFPERIOD_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_PREIOD_L') CREATE INDEX IDX_BCM_PREIOD_L ON T_BCM_STRUCTOFPERIOD_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_PREIOD_L_NAME') CREATE INDEX IDX_BCM_PREIOD_L_NAME ON T_BCM_STRUCTOFPERIOD_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_ACCOUNT_L', 'T_BCM_STRUCTOFACCOUNT_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ACCOUNT_L') CREATE INDEX IDX_BCM_ACCOUNT_L ON T_BCM_STRUCTOFACCOUNT_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_EB_PROJECT_L', 'T_BCM_STRUCTOFPROJECT_L';
EXEC p_DropIdx 'IDX_BCM_EB_PROJECT_L_NAME', 'T_BCM_STRUCTOFPROJECT_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_EB_PROJECT_L') CREATE INDEX IDX_BCM_EB_PROJECT_L ON T_BCM_STRUCTOFPROJECT_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_EB_PROJECT_L_NAME') CREATE INDEX IDX_BCM_EB_PROJECT_L_NAME ON T_BCM_STRUCTOFPROJECT_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_EB_VERSION_L', 'T_BCM_STRUCTOFVERSION_L';
EXEC p_DropIdx 'IDX_BCM_EB_VERSION_L_NAME', 'T_BCM_STRUCTOFVERSION_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_EB_VERSION_L') CREATE INDEX IDX_BCM_EB_VERSION_L ON T_BCM_STRUCTOFVERSION_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_EB_VERSION_L_NAME') CREATE INDEX IDX_BCM_EB_VERSION_L_NAME ON T_BCM_STRUCTOFVERSION_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_UD_L', 'T_BCM_STRUCTOFDEFINED_L';
EXEC p_DropIdx 'IDX_BCM_UD_L_NAME', 'T_BCM_STRUCTOFDEFINED_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_UD_L') CREATE INDEX IDX_BCM_UD_L ON T_BCM_STRUCTOFDEFINED_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_UD_L_NAME') CREATE INDEX IDX_BCM_UD_L_NAME ON T_BCM_STRUCTOFDEFINED_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_DATASORT_L', 'T_BCM_STRUCTOFDATASORT_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_DATASORT_L') CREATE INDEX IDX_BCM_DATASORT_L ON T_BCM_STRUCTOFDATASORT_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_DateType_L', 'T_BCM_STRUCTOFDATETYPE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_DATETYPE_L') CREATE INDEX IDX_BCM_DATETYPE_L ON T_BCM_STRUCTOFDATETYPE_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_ACCOUNTM_L', 'T_BCM_MEMBOFACCOUNT_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ACCOUNTM_L') CREATE INDEX IDX_BCM_ACCOUNTM_L ON T_BCM_MEMBOFACCOUNT_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_CTM_L', 'T_BCM_MEMBOFCHANGETYPE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_CTM_L') CREATE INDEX IDX_BCM_CTM_L ON T_BCM_MEMBOFCHANGETYPE_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_ATM_L', 'T_BCM_MEMBOFAUDITTRIAL_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ATM_L') CREATE INDEX IDX_BCM_ATM_L ON T_BCM_MEMBOFAUDITTRIAL_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_FYM_L', 'T_BCM_MEMBOFFY_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_FYM_L') CREATE INDEX IDX_BCM_FYM_L ON T_BCM_MEMBOFFY_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_PERIODM_L', 'T_BCM_MEMBOFPERIOD_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_PERIODM_L') CREATE INDEX IDX_BCM_PERIODM_L ON T_BCM_MEMBOFPERIOD_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_BPM_L', 'T_BCM_MEMBOFPROCESS_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_BPM_L') CREATE INDEX IDX_BCM_BPM_L ON T_BCM_MEMBOFPROCESS_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_RULEM_L', 'T_BCM_MEMBOFRULE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_RULEM_L') CREATE INDEX IDX_BCM_RULEM_L ON T_BCM_MEMBOFRULE_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_CURRENCYM_L', 'T_BCM_MEMBOFCURRENCY_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_CURRENCYM_L') CREATE INDEX IDX_BCM_CURRENCYM_L ON T_BCM_MEMBOFCURRENCY_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_SCENEM_L', 'T_BCM_MEMBOFSCENE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_SCENEM_L') CREATE INDEX IDX_BCM_SCENEM_L ON T_BCM_MEMBOFSCENE_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_UDM_L', 'T_BCM_MEMBOFDEFINED_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_UDM_L') CREATE INDEX IDX_BCM_UDM_L ON T_BCM_MEMBOFDEFINED_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_EB_PROJECTM_L', 'T_BCM_MEMBOFPROJECT_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_EB_PROJECTM_L') CREATE INDEX IDX_BCM_EB_PROJECTM_L ON T_BCM_MEMBOFPROJECT_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_EB_VERSIONM_L', 'T_BCM_MEMBOFVERSION_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_EB_VERSIONM_L') CREATE INDEX IDX_BCM_EB_VERSIONM_L ON T_BCM_MEMBOFVERSION_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_DATASORTM_L', 'T_BCM_MEMBOFDATASORT_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_DATASORTM_L') CREATE INDEX IDX_BCM_DATASORTM_L ON T_BCM_MEMBOFDATASORT_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_DateType_L2', 'T_BCM_MEMBOFDATETYPE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_DATETYPE_L2') CREATE INDEX IDX_BCM_DATETYPE_L2 ON T_BCM_MEMBOFDATETYPE_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_MEMBOFMYIC_FID', 'T_BCM_MEMBOFMYCOMPANY_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_MEMBOFMYIC_FID') CREATE INDEX IDX_BCM_MEMBOFMYIC_FID ON T_BCM_MEMBOFMYCOMPANY_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_STRUCTOFMYIC_FID', 'T_BCM_STRUCTOFMYCOMPANY_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_STRUCTOFMYIC_FID') CREATE INDEX IDX_BCM_STRUCTOFMYIC_FID ON T_BCM_STRUCTOFMYCOMPANY_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_AnalySolution_FID', 'T_BCM_ANALYTICSSOLUTIONS_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ANALYSOLUTION_FID') CREATE INDEX IDX_BCM_ANALYSOLUTION_FID ON T_BCM_ANALYTICSSOLUTIONS_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_ISSingleMap_l_FID', 'T_BCM_ISSINGLEMAP_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ISSINGLEMAP_L_FID') CREATE INDEX IDX_BCM_ISSINGLEMAP_L_FID ON T_BCM_ISSINGLEMAP_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_InvChangeEntry_L_id', 'T_BCM_INVCHANGEENTRY_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVCHANGEENTRY_L_ID') CREATE INDEX IDX_BCM_INVCHANGEENTRY_L_ID ON T_BCM_INVCHANGEENTRY_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_InvShareRela_l_FID', 'T_BCM_INVSHARERELA_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVSHARERELA_L_FID') CREATE INDEX IDX_BCM_INVSHARERELA_L_FID ON T_BCM_INVSHARERELA_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_T_BCM_TmplColDim_L_FID', 'T_BCM_TMPLCOLDIM_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BCM_TMPLCOLDIM_L_FID') CREATE INDEX IDX_T_BCM_TMPLCOLDIM_L_FID ON T_BCM_TMPLCOLDIM_L ( FDETAILID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_TEMPSTYLESCHEME_FID', 'T_BCM_TEMPSTYLESCHEME_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_TEMPSTYLESCHEME_FID') CREATE INDEX IDX_BCM_TEMPSTYLESCHEME_FID ON T_BCM_TEMPSTYLESCHEME_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BCM_PERML_FK', 'T_BCM_MEMBERPERM_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_PERML_FK') CREATE INDEX IDX_BCM_PERML_FK ON T_BCM_MEMBERPERM_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_T_BCM_MERGECONFIG_L', 'T_BCM_MERGECONFIG_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BCM_MERGECONFIG_L') CREATE INDEX IDX_T_BCM_MERGECONFIG_L ON T_BCM_MERGECONFIG_L ( FID ,FLOCALEID );

 EXEC P_ALTERPK 'PK_T_BCM_LINKAGEMEMBRANGE', 'T_BCM_LINKAGEMEMBRANGE', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_LINKAGERANGE_FID') CREATE INDEX IDX_LINKAGERANGE_FID ON T_BCM_LINKAGEMEMBRANGE ( FID );


EXEC p_DropIdx 'IDX_BCM_CHECKTMPLCATALOG_L_FID', 'T_BCM_CHECKTMPLCATALOG_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_CHECKTMPLCATALOG_L_FID') CREATE INDEX IDX_BCM_CHECKTMPLCATALOG_L_FID ON T_BCM_CHECKTMPLCATALOG_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_CHECKCATALOG_L_FNAME') CREATE INDEX IDX_BCM_CHECKCATALOG_L_FNAME ON T_BCM_CHECKTMPLCATALOG_L ( FNAME ,FID );

EXEC p_DropIdx 'T_BCM_IntegrateScheme_l_fid', 'T_BCM_INTEGRATESCHEME_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_INTEGRATESCHEME_L_FID') CREATE INDEX T_BCM_INTEGRATESCHEME_L_FID ON T_BCM_INTEGRATESCHEME_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INTESCHEME_L_FNAME') CREATE INDEX IDX_BCM_INTESCHEME_L_FNAME ON T_BCM_INTEGRATESCHEME_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_EntityNameRecord_l', 'T_BCM_ENTITYNAMERECORD_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ENTITYNAMERECORD_L') CREATE INDEX IDX_BCM_ENTITYNAMERECORD_L ON T_BCM_ENTITYNAMERECORD_L ( FENTITYID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ENTRECORD_L_FNAME') CREATE INDEX IDX_BCM_ENTRECORD_L_FNAME ON T_BCM_ENTITYNAMERECORD_L ( FNAME ,FENTITYID );

EXEC p_DropIdx 'IDX_T_BCM_Convertdiff_L_fid', 'T_BCM_CONVERTDIFFENTITY_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BCM_CONVERTDIFF_L_FID') CREATE INDEX IDX_T_BCM_CONVERTDIFF_L_FID ON T_BCM_CONVERTDIFFENTITY_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_CONVERTDIFF_L_FNAME') CREATE INDEX IDX_BCM_CONVERTDIFF_L_FNAME ON T_BCM_CONVERTDIFFENTITY_L ( FNAME ,FID );

EXEC p_DropIdx 'IDX_BCM_InvElimTemplate_ID', 'T_BCM_INVELIMTEMPLATE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVELIMTEMPLATE_ID') CREATE INDEX IDX_BCM_INVELIMTEMPLATE_ID ON T_BCM_INVELIMTEMPLATE_L ( FID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVELIMTMPL_NAME') CREATE INDEX IDX_BCM_INVELIMTMPL_NAME ON T_BCM_INVELIMTEMPLATE_L ( FNAME ,FID );

EXEC p_DropIdx 'T_BCM_ISDimMapSrcDefVal_l_FID', 'T_BCM_ISDIMMAPSRCDEFVAL_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISDIMMAPSRCDEFVAL_L_FID') CREATE INDEX T_BCM_ISDIMMAPSRCDEFVAL_L_FID ON T_BCM_ISDIMMAPSRCDEFVAL_L ( FDETAILID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ISDIMMASRDEVA_L_NA') CREATE INDEX IDX_BCM_ISDIMMASRDEVA_L_NA ON T_BCM_ISDIMMAPSRCDEFVAL_L ( FSRCMEMNAME ,FDETAILID );

EXEC p_DropIdx 'T_BCM_ISDimMapTargDefVal_l_FID', 'T_BCM_ISDIMMAPTARGDEFVAL_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_BCM_ISDIMMAPTARGDEFVAL_L_FID') CREATE INDEX T_BCM_ISDIMMAPTARGDEFVAL_L_FID ON T_BCM_ISDIMMAPTARGDEFVAL_L ( FDETAILID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ISDIMMATADEVA_L_NA') CREATE INDEX IDX_BCM_ISDIMMATADEVA_L_NA ON T_BCM_ISDIMMAPTARGDEFVAL_L ( FTAGMEMNAME ,FDETAILID );

EXEC p_DropIdx 'IDX_BCM_INVRELADEFINE_L_FID', 'T_BCM_INVRELATIONDEFINE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVRELADEFINE_L_FID') CREATE INDEX IDX_BCM_INVRELADEFINE_L_FID ON T_BCM_INVRELATIONDEFINE_L ( FENTRYID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVRELADEF_L_FNAME') CREATE INDEX IDX_BCM_INVRELADEF_L_FNAME ON T_BCM_INVRELATIONDEFINE_L ( FNAME ,FENTRYID );


/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_constraint.sql **/
