Civil parishes in Scotland

Civil parishes are small divisions used for statistical purposes and formerly for local government in Scotland. 
Civil parishes gained legal functions in 1845 which parochial boards were established to administer the poor law. Their local government functions were abolished in 1930 with their powers transferred to county or burgh councils. Since 1975, they have been superseded as the smallest unit of local administration in Scotland by community councils.
History.
Civil parishes in Scotland can be dated from 1845, when parochial boards were established to administer the poor law. While they originally corresponded to the parishes of the Church of Scotland, the number and boundaries of parishes soon diverged. Where a parish contained a burgh, a separate "landward" parish was formed for the portion outside the town. 
Until 1891 many parishes lay in more than one county. In that year, under the terms of the Local Government (Scotland) Act 1889, the boundaries of most of the civil parishes and counties were realigned so that each parish was wholly within a single county. In 1894 the parochial boards were replaced by more democratically elected parish councils. 
Parish councils were in turn abolished in 1930, under the Local Government (Scotland) Act 1929, with powers being transferred to county councils in landward areas of counties and burgh councils where they were within a burgh. 
Their boundaries continued to be used to define some of the local authorities created by the Local Government (Scotland) Act 1973 and they continue to be used for census purposes and they are used as part of the coding system for agricultural holdings under the Integrated Administration and Control System (IACS) used to administer schemes within the Common Agricultural Policy. 
According to the website of the General Register Office for Scotland, there are now 871 civil parishes.
Relationship with ecclesiastical parishes.
Civil parish boundaries originally corresponded with the ecclesiastical parishes of the Church of Scotland. As parishes used for religious functions diverged from civil parishes, the former became known as quoad sacra parishes. 
Community councils.
Since 1975, Scotland has been divided into community council areas which are often similar to civil parishes in their boundaries. 
These community council are not equivalent to English parish councils and Welsh community councils and do not have legal powers of their own but in some cases local authorities have a legal obligation to consult them.