With so much technology relying on power from the battery, any interruption will cause not only the loss of radio codes, but more fundamental functions such as ECU, idle, transmission, fueling and electric window settings and, if you are unlucky, the immobiliser will need to be reprogrammed before the engine will start.
All of this can be prevented with a little preparation, using a memory saver that prevents the loss of power to the electrical systems. The simplest and most secure way of connecting to the vehicle is through the EOBD socket (every car/van since year 2000 has one). The Schumacher PMI 7A OBD is fully mobile, equipped with an EOBD plug to connect to the vehicle and has a mains rechargeable 7A/Hr battery that will support the systems for many hours. It can be used in the workshop or at the side of the road, and features an LED display that shows the state of charge of the internal battery.