7 June 2016 Last updated at 19:29 BST
Firefighters pumped water out of several properties in Penicuik and the council said work was ongoing to clear water at Mauricewood Primary School in the town.
The Met Office has issued a yellow 'be aware' weather warning covering a band up the middle of Scotland from the Borders to the Highlands.

Russia has denied that its military is involved in Ukraine, but Mr Poroshenko said 9,000 of its troops were deployed.
Clashes involving tanks took place in two areas west of Donetsk on Wednesday.
There was a "colossal threat" that large-scale fighting would resume, the president told parliament in Kiev.
The outbreak of violence, in the government-held towns of Maryinka and Krasnohorivka, was among the worst in eastern Ukraine since a ceasefire was signed in Minsk in February.
International monitors from the OSCE said that in the hours before and during the fighting around Maryinka a large amount of heavy weapons was spotted moving towards the contact line in rebel-controlled areas.
Government troops fired shells at rebel-held areas on the outskirts of Donetsk.
Ukraine said it had lost five soldiers in the past 24 hours, while the rebels said 15 people including civilians had been killed.
The separatists denied Ukrainian claims that they launched a major offensive in violation of a truce.
The OSCE said that for more than an hour on Wednesday they had tried to contact separatist leaders to halt the fighting, but they were either "unavailable or did not wish" to speak to the monitors.
Russian Foreign Minister Sergei Lavrov, however, accused the authorities in Kiev of jeopardising the Minsk agreement, by placing it "under the constant threat of disruption" and by refusing to engage in direct dialogue with separatist leaders.
The Kremlin has consistently denied sending serving soldiers across the border, although it has acknowledged that "volunteers" have joined the rebels.
If there is a spike in fighting, like the battle in the town of Maryinka on Wednesday, then both sides know they cannot be seen as the aggressor, because they lose credibility and damage the negotiating position of their allies in either Moscow, or in European capitals.
Neither side wants to be seen as responsible for breaking the highly publicised, but so far unsuccessful, Minsk peace agreement.
And bargaining power for either side will become ever more crucial because in three weeks the European Union will decide whether to renew sanctions against Russia.
Read more from Tom
In his annual address to parliament, Mr Poroshenko warned of a "colossal threat" from the rising violence.
"Ukraine's military should be ready for a new offensive by the enemy, as well as a full-scale invasion along the entire border with the Russian Federation," he said. "We must be really prepared for this."
More than 6,400 people have been killed in eastern Ukraine since the conflict began in April 2014 when rebels seized large parts of the two eastern regions, following Russia's annexation of the Crimea peninsula.
Mr Poroshenko said Ukraine had 50,000 troops in the east who were able to defend the country.
What he described as the Kremlin's "plan to sow separatism in south-eastern Ukraine" had failed, he added, and only persisted in areas of the Donetsk and Luhansk regions because of "Russian bayonets".
Heavy rain has caused travel problems, flooding a number of routes in the Scottish Borders.
[NEXT_CONCEPT]
President Petro Poroshenko has told MPs the military must prepare to defend against a possible "full-scale invasion" from Russia, amid a surge of violence in eastern Ukraine.