/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SM_constraint.sql **/
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SM_DELINOTICE_D_CUSTOMER') CREATE INDEX IDX_SM_DELINOTICE_D_CUSTOMER ON T_SM_DELIVERNOTICE_D ( FCUSTOMERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SM_DELIENTRY_MATID') CREATE INDEX IDX_SM_DELIENTRY_MATID ON T_SM_DELIVERNOTICEENTRY ( FMATERIALID ,FID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SM_DELIENTRY_MATMASTERID') CREATE INDEX IDX_SM_DELIENTRY_MATMASTERID ON T_SM_DELIVERNOTICEENTRY ( FMATERIALMASTERID ,FID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SM_DELIENTRY_FOWNERID') CREATE INDEX IDX_SM_DELIENTRY_FOWNERID ON T_SM_DELIVERNOTICEENTRY ( FOWNERID );

 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 ,FID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SM_DELINOTICE_FBIZTIME') CREATE INDEX IDX_SM_DELINOTICE_FBIZTIME ON T_SM_DELIVERNOTICE ( FBIZTIME  DESC );


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