Strongly recommend against.
You might get away with it, for weeks, years, thousands of production units even -- but it will not ultimately be reliable. The reason is EMI.
The 2m cable acts as an antenna, particularly resonant at 1/4 wave, or c*(1/4)/(2m) = 37.5MHz, and odd harmonics thereof (112.5MHz, ...). When such noise is picked up, current primarily flows along the low-impedance connections (VDD/GND) and not through the signal lines, which therefore see a voltage difference with respect to VDD/GND. When the noise exceeds the receivers' noise margins (typically 30% of VDD, or maybe a volt), the logic level is corrupted, and malfunction results. Typically, the effect is a denial-of-service (bus errors are generated, or whatever), but corruption of data already in transit can also occur.
Note, there is some noise immunity innate to the I2C hardware: they specify a 50ns glitch must be ignored. But there are two problems with this: 1. what if multiple glitches occur together, will they be sampled as the beginning (or end) of a pulse then? 2. RF is rectified by the input protection (ESD clamping) diodes, shifting the baseline, and this alone can cause invalid logic states to be received.
The Q factor of such an antenna might be ballpark 5-10, so that the ambient EM fields (in terms of V/m) might be this many times less, to generate the same magnitude of interference on the cable (i.e., this many times more sensitive). It will be much less sensitive at other frequencies, but there will always be random cases where these resonances are excited, and where it is exceptionally vulnerable. Alternately, the Q can be killed by placing a ferrite bead on the cable, at the host end; this merely flattens the response, so it's about the same sensitivity (~1V/m) at most frequencies. Improves the worst-case condition, but not the average. (IEC 61000-6-1 requires 3V/m radiated and 3V conducted.)
What I mean by "get away with it" is, EMI is not evenly distributed. Perhaps in these bands, the most likely culprits are VHF radios (CB, Walkie-Talkies / remote control toys), commercial radio (near your 3rd harmonic), and ESD (which is impulsive and broad spectrum; it'll excite such an antenna with a ringing waveform).
You might simply never have your device exposed to such sources, because of coincidence, or geography, or indeed careful placement. But it could always happen, out in the wild.
Note that -- if you don't need reliable communication, i.e. you can tolerate the sensor being unavailable for some length of time -- maybe mitigation isn't required. Retry immediately to check for impulsive noise (compare results from several consecutive acquisitions?); or if the sample rate can be some seconds, or minutes, maybe even hours -- that might be enough to get a sample through the noise, or wait it out entirely. (Some temperature or barometric pressure sensing applications might be examples for this, for example.)
Note the assumptions underlying this review: I'm assuming the simplest possible connection, using loose wires, or (unshielded) multiconductor or ribbon cable, and no filtering, just direct connection between sensor and host/base unit.
We can take some steps to greatly mitigate these issues. (But I still recommend against using I2C off-board.)
At each end of the cable, add a bypass cap (0.1uF is fine) between VDD/GND.
For each signal (SCL/SDA), add a ferrite bead (220 to 1kΩ at 100MHz) in series, then a shunt capacitor of 220pF. Add ESD protection (usually clamp diodes, like BAT54S, from GND to signal to VDD), and finally a small resistor from ESD diode to the actual I2C interface (chip), typically 10-100 ohms. (The series resistance can't be very high, because of the required VOL into the pullup resistance.)
Use a shielded cable, e.g. screened (preferably braided as well) multiconductor cable, or twin coax (probably much more expensive than required, but if you have it on hand for a one-off, sure why not; then route VDD alongside the pair, VDD signal quality doesn't matter).
Note this necessarily increases capacitance on the bus, reducing maximum speed and length.
The shield must be tied as closely to GND as possible, at both ends. Preferably using a shielded connector with wraparound connection to the shield (circular and D-sub connectors provide these features), with the connector's ground pins tied to PCB ground plane, early and often. (Use ground plane design techniques.) Do not use unshielded headers: the pin plus pigtail / unshielded lengths add up, allowing EMI into the signals, defeating your efforts. A solid ground is required. Even an inch of unshielded length is likely to fail commercial (8kV contact / 15kV air discharge) ESD.
- Use differential signaling.
This is mentioned in other answers, but a deeper explanation of why, is worthwhile.
When it comes to EMI, and RF magic, impedance is king.
The (regular, single-ended) I2C bus has wildly varying impedance. Which is why the rise and fall times are asymmetrical, why filtering sucks, and why cable length sucks.
It's really a quite well constructed standard, for what it is -- nearly minimal connections for on-board communication. That it fails in these ways, when taken off board, is no accident -- it's practically by intent!
But suppose we doubled the number of connections, and instead of having a static pull-up to VDD, we bias the line pair gently (either a bit negative, or just pulled to zero difference with a termination resistor), and drive the line pair, full strength, one up, one down. Well, we'd get a low impedance to start with (typically 100 ohms for twisted pair, would be used here), and we'd get only somewhat lower impedance when driven (CMOS pin drivers are usually 30-70 ohms, though a stronger driver might be used here to keep signal levels up). This makes filtering very easy: we merely need a matched-impedance filter, and this can be arbitrarily high-order to reject out-of-band noise. (Which, since the signals are low frequency pulses -- including down to DC -- a lowpass filter is the best we can do here. Note it should be near a Bessel response, because we're filtering pulses. In practice, we'd never bother with more than 2-3 order anyway, and this distinction is minor.)
Being differential, we can also use common-mode filtering to reject ambient noise sources, without having to compromise as much on (DM) filtering, or bandwidth -- and indeed, since it's differential, we can potentially go without DM filtering at all (at least beyond what's needed for effective CM filtering) and get much, much higher bandwidth while maintaining adequate immunity to ambient noise!
The biggest pitfall of differential I2C interfaces, at least among those that I've seen -- is the lack of extended common-mode input voltage range. That is, the differential bus interface is, probably just conventional CMOS input and output circuits -- internally on the chip, I mean -- they're limited to -0.3V to VDD+0.3V or thereabouts, implying clamp diodes (ESD protection) and all that. So you have really very little noise immunity without CM filtering: as soon as that ±1.5V or so (i.e. VDD/2) margin is exhausted, data corruption sets in. So they're best used with CM filtering.
(Contrast with RS-485, which is a differential line standard, with the same drive levels (3.3/5V), strong output drive (over 100mA), but also tolerates a -8/+12V input range -- considerably more common-mode range, enough for even industrial levels of noise (10V conducted, 10V/m radiated) with little or no filtering required. Unfortunately they didn't choose such a basis for these I2C interfaces; but such a multi-master differential bus does in fact exist: CANbus has RS-485-ish signal levels, even higher CMR, and uses the wired-OR arbitration mechanism of I2C.)
As for personal experience -- I've been required (read: by customer specification) to route I2C between boards before. One case was an HMI (human-machine interface, i.e. pushbuttons and display) board some 10cm away from the main board. I designed the connection to use 10 pin ribbon cable (unshielded), with VDD or GND (both serve as GND for RF purposes) interleaved between (and around) all signal lines (I2C plus a few other signals). Extra ground wires, affords a small degree of shielding by itself. Filtering was added to the signal lines, as described above (ferrite bead, 220pF, ESD diode). I believe the finding was, in EMC testing: it failed at 10V/m at 220MHz (makes sense: that's in the right range for the resonant frequency of the two boards joined by a short cable), and initially testing was done without the ferrite bead, and it was found adding one did the job.
If the cable were any longer, I would expect it to fail even with extra ferrite beads, and another shielding solution would be necessary (perhaps a metallic frame or enclosure to better (AC-)ground the two boards together, shorting out this resonant mode).
(That was a challenging project; the customer also demanded USB connectivity between boxes, carried on multiconductor cables joined with circular connectors. This configuration failed EFT (electrical fast transients, basically rapid-fire ESD produced by relay contacts opening under inductive load) by over a factor of 10. I was unable to find a solution that didn't involve shielded cables and connectors -- metallic circular connectors are readily available, but they cost several times more than the unshielded plastic kind. They got a functional product -- but as I heard it, the unit cost was about twofold higher than expected. This was noted early on; unfortunately, they didn't heed the warning.)