/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_SM_RETURNAPPLYENTRY_R', 'T_SM_RETURNAPPLYENTRY_R', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SM_XSALORDER_R', 'T_SM_XSALORDER_R', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SM_XSALORDER_R' AND KSQL_INDNAME = 'IDX_SM_XSALESORDER_R') CREATE INDEX IDX_SM_XSALESORDER_R ON T_SM_XSALORDER_R ( FCHANGECANCELER );



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