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

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


 EXEC P_ALTERPK 'PK_TCCIT_NON_INSURANCE_SUM', 'T_TCCIT_NON_INSURANCE_SUM', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_INSURANCE_DET', 'T_TCCIT_INSURANCE_DET', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_INSURANCE_SUMMARY', 'T_TCCIT_INSURANCE_SUMMARY', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_CARRY_FWD_LOSS', 'T_TCCIT_CARRY_FWD_LOSS', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_GOV_SUBSIDY_DEFER', 'T_TCCIT_GOV_SUBSIDY_DEFER', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_GOV_SUBSIDY_DEFER') CREATE INDEX IDX_TCCIT_GOV_SUBSIDY_DEFER ON T_TCCIT_GOV_SUBSIDY_DEFER ( FBILLNO ,FORGID );


 EXEC P_ALTERPK 'PK_TCCIT_REC_SUBSIDY', 'T_TCCIT_REC_SUBSIDY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_BOOK_INCOME_REG', 'T_TCCIT_BOOK_INCOME_REG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_NOT_TACCRUAL_BAS', 'T_TCCIT_NOT_TACCRUAL_BAS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_NOT_TACCRUAL_BAS') CREATE INDEX IDX_TCCIT_NOT_TACCRUAL_BAS ON T_TCCIT_NOT_TACCRUAL_BAS ( FBILLNO ,FORGID );


 EXEC P_ALTERPK 'PK_TCCIT_TAX_INCOME_REG', 'T_TCCIT_TAX_INCOME_REG', 'FENTRYID', '1';

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



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