/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IFM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_IFM_PRODUCT', 'T_IFM_PRODUCT', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_IFM_PRODUCT_ENTRY', 'T_IFM_PRODUCT_ENTRY', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_PRODUCT_ENTRY_ID') CREATE  CLUSTERED INDEX IDX_IFM_PRODUCT_ENTRY_ID ON T_IFM_PRODUCT_ENTRY ( FENTRYID );


 EXEC P_ALTERPK 'PK_IFM_PRODUCT_ENTRY_L', 'T_IFM_PRODUCT_ENTRY_L', 'FPKID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_PRODUCT_ENTRY_L_ID') CREATE  CLUSTERED INDEX IDX_IFM_PRODUCT_ENTRY_L_ID ON T_IFM_PRODUCT_ENTRY_L ( FENTRYID );


 EXEC P_ALTERPK 'PK_T_IFM_PRODUCT_L', 'T_IFM_PRODUCT_L', 'FPKID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_PRODUCT_L_ID') CREATE  CLUSTERED INDEX IDX_IFM_PRODUCT_L_ID ON T_IFM_PRODUCT_L ( FID );


 EXEC P_ALTERPK 'PK_IFM_RECTRANSBILL', 'T_IFM_RECTRANSBILL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_RECTRANSBILL_BIZDATE') CREATE INDEX IDX_IFM_RECTRANSBILL_BIZDATE ON T_IFM_RECTRANSBILL ( FBIZDATE );



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