In the UK for the moment the computer at Swanwick assigns the SSR code according to the Uk SSR Code Assignment Plan. That plan is published in the UK Air Pilot ENR 1.6 available on line. In the not too distant future the code will be assigned by a computer in Europe.
I was flying a little Cessna around London a few years ago and noticed that for every controller I spoke to I had to reset my squawk code.
Consequently workload increased and I heard some poor read backs from others too, which decreased capacity.
In the US, France, Germany and Spain it is generally one code - one flight. Much more efficient and less workload.