/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\HPDI_constraint.sql **/
 EXEC P_ALTERPK 'PK_HPDI_BIZDATA_L', 'T_HPDI_BIZDATA_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HPDI_BIZDATABILL', 'T_HPDI_BIZDATABILL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HPDI_BIZDATABILL') CREATE INDEX IDX_HPDI_BIZDATABILL ON T_HPDI_BIZDATABILL ( FBILLNO );


 EXEC P_ALTERPK 'PK_HPDI_BIZDATABILL_L', 'T_HPDI_BIZDATABILL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HPDI_BIZDATABILLENT_L', 'T_HPDI_BIZDATABILLENT_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HPDI_BIZDATABILLENT_L') CREATE INDEX IDX_HPDI_BIZDATABILLENT_L ON T_HPDI_BIZDATABILLENT_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HPDI_BIZDATABILLENT', 'T_HPDI_BIZDATABILLENT', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HPDI_BIZDATABILLENT') CREATE INDEX IDX_HPDI_BIZDATABILLENT ON T_HPDI_BIZDATABILLENT ( FBIZDATACODE );


 EXEC P_ALTERPK 'PK_HPDI_BIZDATA', 'T_HPDI_BIZDATA', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HPDI_BIZDATA') CREATE INDEX IDX_HPDI_BIZDATA ON T_HPDI_BIZDATA ( FBIZDATACODE );



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