/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCCIT_constraint.sql **/
 EXEC P_ALTERPK 'PK_TCCIT_ALL_RULE_CONFIG', 'T_TCCIT_ALL_RULE_CONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_TCCIT_ALL_RULE_CONFIG' AND KSQL_INDNAME = 'IDX_TCCIT_ALL_RULE_CFG_FNUMBER') CREATE INDEX IDX_TCCIT_ALL_RULE_CFG_FNUMBER ON T_TCCIT_ALL_RULE_CONFIG ( FNUMBER );


 EXEC P_ALTERPK 'PK_TCCIT_ALL_RULE_CONFIG_L', 'T_TCCIT_ALL_RULE_CONFIG_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_TCCIT_ALL_RULE_CONFIG_L' AND KSQL_INDNAME = 'IDX_TCCIT_ALL_RULE_CONFIG_L_0') CREATE INDEX IDX_TCCIT_ALL_RULE_CONFIG_L_0 ON T_TCCIT_ALL_RULE_CONFIG_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_TCCIT_SBX_SHAREPLAN', 'T_TCCIT_SBX_SHAREPLAN', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_TCCIT_SBX_SHAREPLAN' AND KSQL_INDNAME = 'IDX_TCCIT_SBX_SP_FNUMBER') CREATE INDEX IDX_TCCIT_SBX_SP_FNUMBER ON T_TCCIT_SBX_SHAREPLAN ( FNUMBER );


 EXEC P_ALTERPK 'PK_TCCIT_SBX_SHAREPLAN_L', 'T_TCCIT_SBX_SHAREPLAN_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_TCCIT_SBX_SHAREPLAN_L' AND KSQL_INDNAME = 'IDX_TCCIT_SBX_SHAREPLAN_L_0') CREATE INDEX IDX_TCCIT_SBX_SHAREPLAN_L_0 ON T_TCCIT_SBX_SHAREPLAN_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_TCCIT_SHAREPLAN_ORG', 'T_TCCIT_SHAREPLAN_ORG', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_TCCIT_SHAREPLAN_ORG' AND KSQL_INDNAME = 'IDX_TCCIT_SHAREPLAN_ORG_FK') CREATE INDEX IDX_TCCIT_SHAREPLAN_ORG_FK ON T_TCCIT_SHAREPLAN_ORG ( FID );


 EXEC P_ALTERPK 'PK_TCCIT_SHAREPLAN_RULE', 'T_TCCIT_SHAREPLAN_RULE', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_TCCIT_SHAREPLAN_RULE' AND KSQL_INDNAME = 'IDX_TCCIT_SHAREPLAN_RULE_FK') CREATE INDEX IDX_TCCIT_SHAREPLAN_RULE_FK ON T_TCCIT_SHAREPLAN_RULE ( FID );



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