/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SM_constraint.sql **/
EXEC p_DropIdx 'IDX_SM_DELINOTICE_FORGID', 'T_SM_DELIVERNOTICE';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SM_DELINOTICE_FORGID') CREATE INDEX IDX_SM_DELINOTICE_FORGID ON T_SM_DELIVERNOTICE ( FORGID ,FBIZTIME  DESC ,FBILLNO  DESC );

 EXEC P_ALTERPK 'PK_T_SM_WFRECORD', 'T_SM_WFRECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SM_WFRECORD_WFSEQ') CREATE INDEX IDX_SM_WFRECORD_WFSEQ ON T_SM_WFRECORD ( FWFSEQ );


 EXEC P_ALTERPK 'PK_T_SM_WFRECORDENTRY', 'T_SM_WFRECORDENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SM_WFRECORDENTRY_FBILLNO') CREATE INDEX IDX_SM_WFRECORDENTRY_FBILLNO ON T_SM_WFRECORDENTRY ( FBILLNO  DESC );



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