/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\PMS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_SM_ADJCUSENTRY', 'T_SM_ADJCUSENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SM_ADJPRIENTRY', 'T_SM_ADJPRIENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SM_SALEPRICEADJUST', 'T_SM_SALEPRICEADJUST', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_SM_SALEPRICEADJUST_L', 'T_SM_SALEPRICEADJUST_L', 'FPKID', '1';

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



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