Five people were taken to the hospital, two of them with serious injuries, after the incident at 10.39am local time (9.39am BST).
Police said the incident “was not a terrorist act”.
Swiss police have identified the suspect, whom they described as being 6ft 2in, bald and of unkempt appearance.
The man was believed to be driving a white Volkswagen minivan with registration plates from the south-eastern Swiss state of Graubuenden.
Police warned “the suspect is dangerous”, but said it was not clear whether he still had the chainsaw.
A rescue helicopter was brought in to help the victims and the old town in Schaffhausen was sealed off after the attack.
A health insurance company which has an office in the Schaffhausen building where the attack took place said two of its employees were taken to hospital, the Swiss daily Blick reported.
CSS spokeswoman Christina Wettstein told Blick the pair were undergoing operations. There is no word yet on their condition.
She said it is not clear who the other three wounded people are, and the company is checking to see if they are customers.
Schaffhausen is a city of about 36,000 north of Zurich, near the border with Germany.