The primary goal of this paper is to provide evidence that can prove true or false the hypothesis that dark matter in the Galactic halo can clump into stellar-mass compact objects. If such objects exist, they would act as lenses to external sources in the Magellanic Clouds, giving rise to an observable effect of microlensing. We present the results of our search for such events, based on data from the second phase of the OGLE survey (1996–2000) towards the Small Magellanic Cloud (SMC). The data set we used comprises 2.1 million monitored sources distributed over an area of 2.4 deg2. We found only one microlensing event candidate, however its poor-quality light curve limited our discussion of the exact distance to the lensing object. Given a single event, taking blending (crowding of stars) into account for the detection-efficiency simulations and deriving the Hubble Space Telescope (HST)-corrected number of monitored stars, the microlensing optical depth is τ= (1.55 ± 1.55) × 10−7. This result is consistent with the expected SMC self-lensing signal, with no need to introduce dark matter microlenses. Rejecting the unconvincing event leads to an upper limit on the fraction of dark matter in the form of massive compact halo objects (MACHOs) of f < 20 per cent for deflector masses around 0.4 M☉ and f < 11 per cent for masses between 0.003 and 0.2 M☉ (95 per cent confidence limit). Our result indicates that the Milky Way's dark matter is unlikely to be clumpy and to form compact objects in the subsolar-mass range.