My 99 A3T was doing the exactly same thing after being stood for a while and the batt went flat. Its now fixed and runs smoothly again :)
Two possible solutions are: - If you had a flat batt or had to disconnect the battery, you need to do the "throttle body adaptation" i cant remembre the procedure exactly, it tells u in yur manual but its something like just after reconnecting the battery: switch your ignition on (DON'T start it yet) leave for ten sec and then start and it should sort it.
- The throtte body needs opening up and cleaning. My local independant Audi dealer in leeds did an excellent job of diagnosing it and putting it right and now runs sweet as a nut once more.
Hope this info helps!
(If you're around Leeds, it's IVC audi - highly recommended)