/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\HPDI_constraint.sql **/
 EXEC P_ALTERPK 'PK_HPDI_SALARYVBILLDETAIL', 'T_HPDI_SALARYVBILLDETAIL', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_SALARYVBILLDETAIL' AND KSQL_INDNAME = 'IDX_HPDI_SALARYVBILLDETAIL') CREATE INDEX IDX_HPDI_SALARYVBILLDETAIL ON T_HPDI_SALARYVBILLDETAIL ( FENTRYID );


 EXEC P_ALTERPK 'PK_HPDI_SALARYVERBILL', 'T_HPDI_SALARYVERBILL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_SALARYVERBILL' AND KSQL_INDNAME = 'IDX_HPDI_SALVBILL_FTASKCID') CREATE INDEX IDX_HPDI_SALVBILL_FTASKCID ON T_HPDI_SALARYVERBILL ( FTASKCENTERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_SALARYVERBILL' AND KSQL_INDNAME = 'IDX_HPDI_SALVBILL_FBILLNO') CREATE INDEX IDX_HPDI_SALVBILL_FBILLNO ON T_HPDI_SALARYVERBILL ( FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_SALARYVERBILL' AND KSQL_INDNAME = 'IDX_HPDI_SALVBILL_FRELBILLID') CREATE INDEX IDX_HPDI_SALVBILL_FRELBILLID ON T_HPDI_SALARYVERBILL ( FRELBILLID );


 EXEC P_ALTERPK 'PK_HPDI_SALARYVERBILL_L', 'T_HPDI_SALARYVERBILL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HPDI_SALARYVERBILLENT', 'T_HPDI_SALARYVERBILLENT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HPDI_SINSURVBILLDETAIL', 'T_HPDI_SINSURVBILLDETAIL', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_SINSURVBILLDETAIL' AND KSQL_INDNAME = 'IDX_HPDI_SINSURVBILLDETAIL') CREATE INDEX IDX_HPDI_SINSURVBILLDETAIL ON T_HPDI_SINSURVBILLDETAIL ( FENTRYID );


 EXEC P_ALTERPK 'PK_HPDI_SINSURVERBILL', 'T_HPDI_SINSURVERBILL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_SINSURVERBILL' AND KSQL_INDNAME = 'IDX_HPDI_SINVBILL_FRELBILLID') CREATE INDEX IDX_HPDI_SINVBILL_FRELBILLID ON T_HPDI_SINSURVERBILL ( FRELBILLID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_SINSURVERBILL' AND KSQL_INDNAME = 'IDX_HPDI_SINSVBILL_FTASKCID') CREATE INDEX IDX_HPDI_SINSVBILL_FTASKCID ON T_HPDI_SINSURVERBILL ( FTASKCENTERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_SINSURVERBILL' AND KSQL_INDNAME = 'IDX_HPDI_SINVBILL_FBILLNO') CREATE INDEX IDX_HPDI_SINVBILL_FBILLNO ON T_HPDI_SINSURVERBILL ( FBILLNO );


 EXEC P_ALTERPK 'PK_HPDI_SINSURVERBILL_L', 'T_HPDI_SINSURVERBILL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HPDI_SINSURVERBILLENT', 'T_HPDI_SINSURVERBILLENT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HPDI_SUMMARYVBILL', 'T_HPDI_SUMMARYVBILL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_SUMMARYVBILL' AND KSQL_INDNAME = 'IDX_HPDI_SUMVBILL_FBILLNO') CREATE INDEX IDX_HPDI_SUMVBILL_FBILLNO ON T_HPDI_SUMMARYVBILL ( FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_SUMMARYVBILL' AND KSQL_INDNAME = 'IDX_HPDI_SUMVBILL_FTASKCID') CREATE INDEX IDX_HPDI_SUMVBILL_FTASKCID ON T_HPDI_SUMMARYVBILL ( FTASKCENTERID );


 EXEC P_ALTERPK 'PK_HPDI_SUMMARYVBILL_L', 'T_HPDI_SUMMARYVBILL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HPDI_TAXVBILLDETAIL', 'T_HPDI_TAXVBILLDETAIL', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_TAXVBILLDETAIL' AND KSQL_INDNAME = 'IDX_HPDI_TAXVBILLDETAIL') CREATE INDEX IDX_HPDI_TAXVBILLDETAIL ON T_HPDI_TAXVBILLDETAIL ( FENTRYID );


 EXEC P_ALTERPK 'PK_HPDI_TAXVERBILL', 'T_HPDI_TAXVERBILL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_TAXVERBILL' AND KSQL_INDNAME = 'IDX_HPDI_TAXVBILL_FTASKCID') CREATE INDEX IDX_HPDI_TAXVBILL_FTASKCID ON T_HPDI_TAXVERBILL ( FTASKCENTERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_TAXVERBILL' AND KSQL_INDNAME = 'IDX_HPDI_TAXVBILL_FRELBILLID') CREATE INDEX IDX_HPDI_TAXVBILL_FRELBILLID ON T_HPDI_TAXVERBILL ( FRELBILLID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_TAXVERBILL' AND KSQL_INDNAME = 'IDX_HPDI_TAXVBILL_FBILLNO') CREATE INDEX IDX_HPDI_TAXVBILL_FBILLNO ON T_HPDI_TAXVERBILL ( FBILLNO );


 EXEC P_ALTERPK 'PK_HPDI_TAXVERBILL_L', 'T_HPDI_TAXVERBILL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HPDI_TAXVERBILLENT', 'T_HPDI_TAXVERBILLENT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HPDI_VERIFYBILLCONFIG', 'T_HPDI_VERIFYBILLCONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HPDI_VERIFYBILLCONFIG' AND KSQL_INDNAME = 'IDX_HPDI_VERCFG_FROMID') CREATE INDEX IDX_HPDI_VERCFG_FROMID ON T_HPDI_VERIFYBILLCONFIG ( FFORMID );



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