Several condensations heated externally by nearby hot stars are present in the Sgr B2 region for which H2O far-IR lines are expected to probe only an external low-density and high temperature section. Millimeter-wave lines can penetrate deeper into them ( higher densities and lower T-k). We have conducted a study combining H2O lines in both spectral regions using the ISO (far-IR lines) and the IRAM 30m telescope ( 183 GHz line). The far-IR H2O lines, seen in absorption, are optically thick. They form in the outermost gas in front of the far-IR continuum sources, probing a maximum visual extinction of similar to 5-10 mag. IR photons from the dust play a dominant role in their excitation. We conclude, based on observations of the CO J = 7 - 6 line at 806.65 GHz, and the lack of emission from the far- IR CO lines, that the gas density has to be below similar to 10(4) cm(-3). Using the gas kinetic temperature and density derived from OH, CO, and other molecular species, we derive a water column density of (9 +/- 3); 10(16) cm(-2) in the absorbing gas, implying an abundance of similar or equal to(1 - 2) x 10(-5) in this region. The resulting relatively low H2O/OH abundance ratio, similar or equal to 2 - 4, is a signature of UV photon-dominated surface layers traced by far-IR observations. As a consequence, the temperature of the absorbing gas is high, T-k similar or equal to 300 - 500 K, which allows very efficient neutral-neutral reactions producing H2O and OH. Finally, the 183.31 GHz data allow one to trace the inner, denser (n(H-2) >= 10(5) - 10(6) cm(-3)), and colder (T-k similar to 40K) gas. The emission is very strong toward the cores with an estimated water vapor abundance of a few x10(-7). There is also moderate extended emission around Sgr B2 main condensations, in agreement with the water vapor abundance derived from far- IR H2O lines.