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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_PROFITS_ITEMS') CREATE INDEX IDX_TCCIT_PROFITS_ITEMS ON T_TCCIT_PROFITS_ITEMS ( FNUMBER );


 EXEC P_ALTERPK 'PK_TCCIT_PROFITS_ITEMS_L', 'T_TCCIT_PROFITS_ITEMS_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCCIT_PROFITS_ITEMS_L_0') CREATE INDEX IDX_TCCIT_PROFITS_ITEMS_L_0 ON T_TCCIT_PROFITS_ITEMS_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_TCCIT_PROFITS_ENTRY', 'T_TCCIT_PROFITS_ENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_DEPRECIATE_ORIGIN', 'T_TCCIT_DEPRECIATE_ORIGIN', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCCIT_YJ_PROFITS_ACCDET', 'T_TCCIT_YJ_PROFITS_ACCDET', 'FID', '1';

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



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