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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_POLICY_A') CREATE INDEX IDX_TCCIT_POLICY_A ON T_TCCIT_POLICY_A ( FINCOMEOTHER );


 EXEC P_ALTERPK 'PK_TCCIT_INCOME_OTHER_DET', 'T_TCCIT_INCOME_OTHER_DET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_INCOME_OTHER_DET') CREATE INDEX IDX_TCCIT_INCOME_OTHER_DET ON T_TCCIT_INCOME_OTHER_DET ( FORGID ,FSKSSQQ ,FSKSSQZ ,FRULEID ,FITEMNUMBER );


 EXEC P_ALTERPK 'PK_TCCIT_INCOME_OTHER_SUM', 'T_TCCIT_INCOME_OTHER_SUM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_INCOME_OTHER_SUM') CREATE INDEX IDX_TCCIT_INCOME_OTHER_SUM ON T_TCCIT_INCOME_OTHER_SUM ( FORGID ,FSKSSQQ ,FSKSSQZ );


 EXEC P_ALTERPK 'PK_TCCIT_OTHER_OTHER_DET', 'T_TCCIT_OTHER_OTHER_DET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_OTHER_OTHER_DET') CREATE INDEX IDX_TCCIT_OTHER_OTHER_DET ON T_TCCIT_OTHER_OTHER_DET ( FORGID ,FSKSSQQ ,FSKSSQZ ,FRULEID ,FITEMNUMBER );


 EXEC P_ALTERPK 'PK_TCCIT_OTHER_OTHER_SUM', 'T_TCCIT_OTHER_OTHER_SUM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_OTHER_OTHER_SUM') CREATE INDEX IDX_TCCIT_OTHER_OTHER_SUM ON T_TCCIT_OTHER_OTHER_SUM ( FORGID ,FSKSSQQ ,FSKSSQZ );


 EXEC P_ALTERPK 'PK_TCCIT_OTHER_SPEC_DET', 'T_TCCIT_OTHER_SPEC_DET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_OTHER_SPEC_DET') CREATE INDEX IDX_TCCIT_OTHER_SPEC_DET ON T_TCCIT_OTHER_SPEC_DET ( FORGID ,FSKSSQQ ,FSKSSQZ ,FRULEID ,FITEMNUMBER );


 EXEC P_ALTERPK 'PK_TCCIT_OTHER_SPEC_SUM', 'T_TCCIT_OTHER_SPEC_SUM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_OTHER_SPEC_SUM') CREATE INDEX IDX_TCCIT_OTHER_SPEC_SUM ON T_TCCIT_OTHER_SPEC_SUM ( FORGID ,FSKSSQQ ,FSKSSQZ );


 EXEC P_ALTERPK 'PK_TCCIT_SPEC_OTHER_DET', 'T_TCCIT_SPEC_OTHER_DET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_SPEC_OTHER_DET') CREATE INDEX IDX_TCCIT_SPEC_OTHER_DET ON T_TCCIT_SPEC_OTHER_DET ( FORGID ,FSKSSQQ ,FSKSSQZ ,FRULEID ,FITEMNUMBER );


 EXEC P_ALTERPK 'PK_TCCIT_SPEC_OTHER_SUM', 'T_TCCIT_SPEC_OTHER_SUM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_SPEC_OTHER_SUM') CREATE INDEX IDX_TCCIT_SPEC_OTHER_SUM ON T_TCCIT_SPEC_OTHER_SUM ( FORGID ,FSKSSQQ ,FSKSSQZ );


 EXEC P_ALTERPK 'PK_TCCIT_ZC_OTHER_SUM', 'T_TCCIT_ZC_OTHER_SUM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_ZC_OTHER_SUM') CREATE INDEX IDX_TCCIT_ZC_OTHER_SUM ON T_TCCIT_ZC_OTHER_SUM ( FORGID ,FSKSSQQ ,FSKSSQZ );


 EXEC P_ALTERPK 'PK_TCCIT_ZCTZ_OTHER_DET', 'T_TCCIT_ZCTZ_OTHER_DET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_ZCTZ_OTHER_DET') CREATE INDEX IDX_TCCIT_ZCTZ_OTHER_DET ON T_TCCIT_ZCTZ_OTHER_DET ( FORGID ,FSKSSQQ ,FSKSSQZ ,FRULEID ,FITEMNUMBER );


 EXEC P_ALTERPK 'PK_TCCIT_ASSET_DISPOSE_DET', 'T_TCCIT_ASSET_DISPOSE_DET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_ASSET_DISPOSE_DET') CREATE INDEX IDX_TCCIT_ASSET_DISPOSE_DET ON T_TCCIT_ASSET_DISPOSE_DET ( FORGID ,FSKSSQQ ,FSKSSQZ ,FRULEID ,FITEMNUMBER );


 EXEC P_ALTERPK 'PK_TCCIT_ASSET_DISPOSE_SUM', 'T_TCCIT_ASSET_DISPOSE_SUM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_ASSET_DISPOSE_SUM') CREATE INDEX IDX_TCCIT_ASSET_DISPOSE_SUM ON T_TCCIT_ASSET_DISPOSE_SUM ( FORGID ,FSKSSQQ ,FSKSSQZ ,FITEMTYPE );


 EXEC P_ALTERPK 'PK_TCCIT_PROFIT_COST_DET', 'T_TCCIT_PROFIT_COST_DET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_PROFIT_COST_DET') CREATE INDEX IDX_TCCIT_PROFIT_COST_DET ON T_TCCIT_PROFIT_COST_DET ( FORGID ,FSKSSQQ ,FSKSSQZ ,FRULEID ,FITEMNUMBER );


 EXEC P_ALTERPK 'PK_TCCIT_PROFIT_COST_SUM', 'T_TCCIT_PROFIT_COST_SUM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_PROFIT_COST_SUM') CREATE INDEX IDX_TCCIT_PROFIT_COST_SUM ON T_TCCIT_PROFIT_COST_SUM ( FITEMTYPE ,FORGID ,FSKSSQQ ,FSKSSQZ );


 EXEC P_ALTERPK 'PK_TCCIT_PROFIT_FEES_DET', 'T_TCCIT_PROFIT_FEES_DET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_PROFIT_FEES_DET') CREATE INDEX IDX_TCCIT_PROFIT_FEES_DET ON T_TCCIT_PROFIT_FEES_DET ( FORGID ,FSKSSQQ ,FSKSSQZ ,FRULEID ,FITEMNUMBER );


 EXEC P_ALTERPK 'PK_TCCIT_PROFIT_FEES_SUM', 'T_TCCIT_PROFIT_FEES_SUM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_PROFIT_FEES_SUM') CREATE INDEX IDX_TCCIT_PROFIT_FEES_SUM ON T_TCCIT_PROFIT_FEES_SUM ( FITEMTYPE ,FORGID ,FSKSSQQ ,FSKSSQZ );


 EXEC P_ALTERPK 'PK_TCCIT_PROFIT_INCOME_DET', 'T_TCCIT_PROFIT_INCOME_DET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_PROFIT_INCOME_DET') CREATE INDEX IDX_TCCIT_PROFIT_INCOME_DET ON T_TCCIT_PROFIT_INCOME_DET ( FORGID ,FSKSSQQ ,FSKSSQZ ,FRULEID ,FITEMNUMBER );


 EXEC P_ALTERPK 'PK_TCCIT_PROFIT_INCOME_SUM', 'T_TCCIT_PROFIT_INCOME_SUM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_PROFIT_INCOME_SUM') CREATE INDEX IDX_TCCIT_PROFIT_INCOME_SUM ON T_TCCIT_PROFIT_INCOME_SUM ( FITEMTYPE ,FORGID ,FSKSSQQ ,FSKSSQZ );



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