/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BASE_constraint.sql **/
EXEC p_DropIdx 'IDX_T_BD_MATERIAL_STATUSENABLE', 'T_BD_MATERIAL';
EXEC p_DropIdx 'IDX_T_BD_MATERIAL_MASTER', 'T_BD_MATERIAL';
EXEC p_DropIdx 'IDX_T_BD_MATERIAL_STATUS', 'T_BD_MATERIAL';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_MATERIAL_MASTERID') CREATE INDEX IDX_T_BD_MATERIAL_MASTERID ON T_BD_MATERIAL ( FMASTERID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_MATERIAL_STATUS') CREATE INDEX IDX_T_BD_MATERIAL_STATUS ON T_BD_MATERIAL ( FENABLE ,FSTATUS );

EXEC p_DropIdx 'IDX_T_BD_SUPPLIER_ECSSS', 'T_BD_SUPPLIER';
EXEC p_DropIdx 'IDX_T_BD_SUPPLIER_MASTER', 'T_BD_SUPPLIER';
EXEC p_DropIdx 'IDX_T_BD_SUPPLIER_STATUS', 'T_BD_SUPPLIER';
EXEC p_DropIdx 'IDX_T_BD_SUPPLIER_BIZPT', 'T_BD_SUPPLIER';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_SUPPLIER_ECSSS') CREATE INDEX IDX_T_BD_SUPPLIER_ECSSS ON T_BD_SUPPLIER ( FENABLE ,FSUPPLIERSTATUS ,FSTATUS );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_SUPPLIER_MASTERID') CREATE INDEX IDX_T_BD_SUPPLIER_MASTERID ON T_BD_SUPPLIER ( FMASTERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_SUPPLIER_GROUP') CREATE INDEX IDX_T_BD_SUPPLIER_GROUP ON T_BD_SUPPLIER ( FGROUPID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_SUPPLIER_BIZPT') CREATE INDEX IDX_T_BD_SUPPLIER_BIZPT ON T_BD_SUPPLIER ( FBIZPARTNERID );

EXEC p_DropIdx 'IDX_T_BD_CUSTOMER_ECSSS', 'T_BD_CUSTOMER';
EXEC p_DropIdx 'IDX_T_BD_CUSTOMER_MASTER', 'T_BD_CUSTOMER';
EXEC p_DropIdx 'IDX_T_BD_CUSTOMER_STATUS', 'T_BD_CUSTOMER';
EXEC p_DropIdx 'IDX_T_BD_CUSTOMER_BIZPT', 'T_BD_CUSTOMER';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_CUSTOMER_MASTERID') CREATE INDEX IDX_T_BD_CUSTOMER_MASTERID ON T_BD_CUSTOMER ( FMASTERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_CUSTOMER_ECSSS') CREATE INDEX IDX_T_BD_CUSTOMER_ECSSS ON T_BD_CUSTOMER ( FENABLE ,FCUSTOMERSTATUS ,FSTATUS );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_CUSTOMER_GROUP') CREATE INDEX IDX_T_BD_CUSTOMER_GROUP ON T_BD_CUSTOMER ( FGROUPID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_CUSTOMER_BIZPT') CREATE INDEX IDX_T_BD_CUSTOMER_BIZPT ON T_BD_CUSTOMER ( FBIZPARTNERID );


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