/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCCIT_constraint.sql **/
 EXEC P_ALTERPK 'PK_TCCIT_BALANCE_REG', 'T_TCCIT_BALANCE_REG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_FINANCIAL_REG', 'T_TCCIT_FINANCIAL_REG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_IN_INCOME_REG', 'T_TCCIT_IN_INCOME_REG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_PAY_REG', 'T_TCCIT_PAY_REG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_ZERO_RATING_INOUT', 'T_TCCIT_ZERO_RATING_INOUT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_ZERO_RATING_INOUT') CREATE INDEX IDX_TCCIT_ZERO_RATING_INOUT ON T_TCCIT_ZERO_RATING_INOUT ( FBILLNO );


 EXEC P_ALTERPK 'PK_TCCIT_QYSDS_A105000_B', 'T_TCCIT_QYSDS_A105000_B', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_QYSDS_A105000_B') CREATE INDEX IDX_TCCIT_QYSDS_A105000_B ON T_TCCIT_QYSDS_A105000_B ( FBXBZJJ );


 EXEC P_ALTERPK 'PK_TCCIT_QYSDS_A105120_DK', 'T_TCCIT_QYSDS_A105120_DK', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_QYSDS_A105120_DK') CREATE INDEX IDX_TCCIT_QYSDS_A105120_DK ON T_TCCIT_QYSDS_A105120_DK ( FEWBLXH ,FEWBLNAME ,FSBBID );


 EXEC P_ALTERPK 'PK_TCCIT_INVEST_ASSET_JZBD', 'T_TCCIT_INVEST_ASSET_JZBD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_INVEST_ASSET_JZBD') CREATE INDEX IDX_TCCIT_INVEST_ASSET_JZBD ON T_TCCIT_INVEST_ASSET_JZBD ( FBILLNO );


 EXEC P_ALTERPK 'PK_TCCIT_INVEST_JZBD_XX', 'T_TCCIT_INVEST_JZBD_XX', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_ASSET_LOSS_PT_B', 'T_TCCIT_ASSET_LOSS_PT_B', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_ASSET_LOSS_PT', 'T_TCCIT_ASSET_LOSS_PT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_ASSET_LOSS_PT') CREATE INDEX IDX_TCCIT_ASSET_LOSS_PT ON T_TCCIT_ASSET_LOSS_PT ( FBILLNO );


 EXEC P_ALTERPK 'PK_TCCIT_GETRE_DETAIL', 'T_TCCIT_GETRE_DETAIL', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_GETREDUCE_ACC', 'T_TCCIT_GETREDUCE_ACC', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_GETREDUCE_ACC') CREATE INDEX IDX_TCCIT_GETREDUCE_ACC ON T_TCCIT_GETREDUCE_ACC ( FBILLNO );


 EXEC P_ALTERPK 'PK_TCCIT_ZERO_RATING_ENTRY', 'T_TCCIT_ZERO_RATING_ENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_ZERO_RATING_MIDD', 'T_TCCIT_ZERO_RATING_MIDD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_ZERO_RATING_MIDD') CREATE INDEX IDX_TCCIT_ZERO_RATING_MIDD ON T_TCCIT_ZERO_RATING_MIDD ( FORGID ,FYEAR );


 EXEC P_ALTERPK 'PK_TCCIT_ZERO_RATING_SUM', 'T_TCCIT_ZERO_RATING_SUM', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_GETREDU_SUM', 'T_TCCIT_GETREDU_SUM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_GETREDU_SUM') CREATE INDEX IDX_TCCIT_GETREDU_SUM ON T_TCCIT_GETREDU_SUM ( FORGID );



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