Sweating is controlled by the parasympathetic nervous system, and happens in response to a need or cooling and also as a side effect of excitement.
The cooling effect is important. In hot climates a person would die if he did not sweat adequately. Sweating is triggered by a ‘thermostat centre in the brain. Interestingly, the sweating increases the longer a person is in hot conditions, rather than the reverse (most of us would expect a person in such conditions to sweat less as he got used to them).
On his first day in hot conditions a person will sweat about one and a half litres of fluid an hour, and after 10 days or so, this will double. By the end of six weeks he will be sweating at the rate of about three and a half litres an hour. But, one important point, the sweat will become progressively less salty. This is an important protective point, because a person who has lost a lot of salt via sweat can fell very ill indeed (this is why the diets in most hot countries tend to be salty anchovies and olives, for example).
People who have always lived in a temperate climate will have many of their sweat glands inactive, but people who live in the tropics tend to be much more efficient sweaters because all their glands operate fully.
The sweating of nervousness or excitement is due to the action of the parasympathetic nervous system, operating via a substance called acetylcholine which is similar to adrenalin. Control of anxiety by tranquillizers will reduce this sort of sweating, which is often very tiresome.
If sweating in some areas notably the armpits becomes a severe embarrassment, interruption of the sympathetic nerves which supply the area may give permanent relief.