A search for the rare decays B(s)(0) → μ+ μ- and B(0) → μ+ μ- is performed in pp collisions at sqrt[s] = 7 TeV, with a data sample corresponding to an integrated luminosity of 1.14 fb(-1), collected by the CMS experiment at the LHC. In both cases, the number of events observed after all selection requirements is consistent with expectations from background and standard-model signal predictions. The resulting upper limits on the branching fractions are B(B(s)(0) → μ+ μ-) < 1.9 × 10(-8) and B(B(0) → μ+ μ-)<4.6 × 10(-9), at 95% confidence level.