The number of dairy farms in Scotland has decreased by 17 to 957, the lowest number since records began in 1903, according to the latest analysis by the Scottish Dairy Cattle Association (SDCA).

That statistic should come as no surprise to anyone with any knowledge of milk production, although some may wonder why more farmers didn't leave the sector considering the torrid financial times the industry has been through in the last couple of years.

While the number of dairy cows also decreased, down by 2529 to 173,306, the head count is still the second highest since 1997. The average size of herd in the year has increased by one to 181 milking cows.

Commenting on the results, SDCA Secretary Janette Mathie said: "Overall 2016 has been a horrible experience for many dairy farmers with farm-gate prices below the cost of production for much of the year. Prices now show an improving trend which I hope will continue to rise in line with the world market for dairy products.

"The SDCA would strongly advocate that industry-funded bodies spend a far larger share of their funding promoting dairy produce to the public, which in turn would benefit both the producer and milk processor."

NFU Scotland Milk Policy Manager George Jamieson said: "After two years when almost all Scottish dairy farmers have been unable to cover costs, never mind invest, many are still in a precarious financial position and have only survived by making drastic decisions to keep afloat.

"While previous periods of restructuring in the dairy sector have seen the less-efficient and smaller farmers as most at risk, the recent crisis has placed many forward-thinking, progressive dairy farmers in jeopardy - a fact acknowledged by Defra Farming Minister George Eustice when he addressed the Semex Dairy Conference in Glasgow this week.

"The risks remain significant. Prospects and opportunities for the global dairy sector, given population growth and urbanisation, will drive demand by 2 per cent per year, but it is a sector that remains highly competitive and volatile.

"The recurring theme from speakers at this week's conference was that innovation, collaboration and trust within the supply chain were essential if UK dairy is to be sustainable and competitive.

"To help achieve that, the farming unions have met with Mr Eustice and Scottish Cabinet Secretary Fergus Ewing to promote the urgent need for movement on the code of conduct on milk contracts, more government engagement to develop meaningful producer representation and a Grocery Code Adjudicator whose remit covers the entire supply chain."