/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\HDM_constraint.sql **/
 EXEC P_ALTERPK 'PK_HDM_DOCUMENTORG', 'T_HDM_DOCUMENTORG', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HDM_TRANSFERBATCH', 'T_HDM_TRANSFERBATCH', 'FMID', '1';

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


 EXEC P_ALTERPK 'PK_HDM_TRANSFERBATCH_L', 'T_HDM_TRANSFERBATCH_L', 'FPKID', '1';

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



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