/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_constraint.sql **/
 EXEC P_ALTERPK 'PK_TCTB_TAXYEAR', 'T_TCTB_TAXYEAR', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_TCTB_TAXYEAR_ENTITY', 'T_TCTB_TAXYEAR_ENTITY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_TCTB_TAXYEAR_L', 'T_TCTB_TAXYEAR_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_TCTB_TAXYEAR_ORGENTITY', 'T_TCTB_TAXYEAR_ORGENTITY', 'FENTRYID', '1';

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



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