Camshaft position sensors do fail now and again, sometimes without ill effects apart from fault code, other times affect engine running. You probably want to change that first, new are quite expensive(over £200) but they are known fail so it is a risk when buying second hand. There is 2 of them, 1 on each bank, G40 will be on back of bank 2 left side of the engine, cylinders 4-6. But fault code 17746 should be for sensor G163 which is on bank 1, so this is a bit confusing
Timing tools for 30V V6 can be bought on e-bay at reasonable price not like expensive ones for 32V V8's. There is 2 tools needed, examples on the e-bay links below.
http://www.ebay.co.uk/itm/VW-AUDI-V6...item418212bf0e
http://www.ebay.co.uk/itm/Locking-Cr...item3f3298624c
Also check measuring blocks for learned lambda values, should be within -10..+10% and no more than 4% difference between banks. If the difference is more than 4% it definitely needs timing done but even if it is less still might need doing.
These V6 seem to be sensitive to overheating so it might have suffered some damage if coolant had leaked out and overheated.