/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\TPO_constraint.sql **/
 EXEC P_ALTERPK 'PK_TPO_TCVAT_TAXPERIOD', 'T_TPO_TCVAT_TAXPERIOD', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TPO_TCVAT_TAXPERIOD_NUM') CREATE  CLUSTERED INDEX IDX_T_TPO_TCVAT_TAXPERIOD_NUM ON T_TPO_TCVAT_TAXPERIOD ( FNUMBER );


 EXEC P_ALTERPK 'PK_TPO_TCVAT_TAXRATES_L', 'T_TPO_TCVAT_TAXRATES_L', 'FPKID', '0';

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


 EXEC P_ALTERPK 'PK_TPO_TCVAT_TAXRATES', 'T_TPO_TCVAT_TAXRATES', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TPO_TCVAT_TAXRATES_NUM') CREATE  CLUSTERED INDEX IDX_T_TPO_TCVAT_TAXRATES_NUM ON T_TPO_TCVAT_TAXRATES ( FNUMBER );


 EXEC P_ALTERPK 'PK_TPO_TCVAT_TAXPERIOD_L', 'T_TPO_TCVAT_TAXPERIOD_L', 'FPKID', '0';

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


 EXEC p_AlterPK 'PK_T_TPO_TAXITEMRATEENTRY_L', 'T_TPO_TAXITEMRATEENTRY_L', 'FPKID', '0';
EXEC p_DropIdx 'IDX_T_TPO_TAXITEM_L_FID', 'T_TPO_TAXITEMRATEENTRY_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TPO_TAXITEM_L_FID') CREATE  CLUSTERED INDEX IDX_T_TPO_TAXITEM_L_FID ON T_TPO_TAXITEMRATEENTRY_L ( FENTRYID );


/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\TPO_constraint.sql **/
