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

 EXEC P_ALTERPK 'PK_T_TPO_TCVAT_ASSISTENTRY', 'T_TPO_TCVAT_ASSISTENTRY', 'FENTRYID', '1';
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TPO_ASSISTENTRY_FID') CREATE INDEX IDX_T_TPO_ASSISTENTRY_FID ON T_TPO_TCVAT_ASSISTENTRY ( FID );
 
 EXEC P_ALTERPK 'PK_T_TPO_TCVAT_BIZDEFENTRY', 'T_TPO_TCVAT_BIZDEFENTRY', 'FENTRYID', '1';
  
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TPO_DEFENTRY_NUM') CREATE INDEX IDX_T_TPO_DEFENTRY_NUM ON T_TPO_TCVAT_BIZDEFENTRY ( FNUMBER );

 EXEC P_ALTERPK 'PK_T_TPO_TAXITEMRATE', 'T_TPO_TAXITEMRATE', 'FID', '1';

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

 EXEC P_ALTERPK 'PK_T_TPO_TCVAT_ASSIST', 'T_TPO_TCVAT_ASSIST', 'FID', '1';
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TPO_TCVAT_ASSIST_FNUMBER') CREATE INDEX IDX_T_TPO_TCVAT_ASSIST_FNUMBER ON T_TPO_TCVAT_ASSIST ( FNUMBER );

 EXEC P_ALTERPK 'PK_T_TPO_TCVAT_BIZDEF', 'T_TPO_TCVAT_BIZDEF', 'FID', '1';
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TPO_TCVAT_BIZDEF_FNUMBER') CREATE INDEX IDX_T_TPO_TCVAT_BIZDEF_FNUMBER ON T_TPO_TCVAT_BIZDEF ( FNUMBER );
 
 EXEC P_ALTERPK 'PK_T_TPO_TCVAT_ASSIST_TREE', 'T_TPO_TCVAT_ASSIST_TREE', 'FID', '1';

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

 EXEC P_ALTERPK 'PK_T_TPO_TAXITEMRATEENTRY', 'T_TPO_TAXITEMRATEENTRY', 'FENTRYID', '1';

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

 EXEC P_ALTERPK 'PK_T_TPO_TCVAT_BIZDEF_TREE', 'T_TPO_TCVAT_BIZDEF_TREE', 'FID', '1';
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TPO_BIZTREE_FNUMBER') CREATE INDEX IDX_T_TPO_BIZTREE_FNUMBER ON T_TPO_TCVAT_BIZDEF_TREE ( FNUMBER );

 EXEC P_ALTERPK 'PK_T_TPO_TAXITEMRATE_L', 'T_TPO_TAXITEMRATE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_TPO_TAXITEMRATEENTRY_L', 'T_TPO_TAXITEMRATEENTRY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_TPO_TCVAT_ASSIST_L', 'T_TPO_TCVAT_ASSIST_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_TPO_TCVAT_BIZDEF_L', 'T_TPO_TCVAT_BIZDEF_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_TPO_TCVAT_ASSIST_TREE_L', 'T_TPO_TCVAT_ASSIST_TREE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_TPO_TCVAT_BIZDEF_TREE_L', 'T_TPO_TCVAT_BIZDEF_TREE_L', 'FPKID', '1';

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



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