If your ancestor went to one of Scotland’s colleges, universities, or schools, he or she may be in the institution’s enrollment records. Some of these records have been published, notably for the sixteenth to the nineteenth centuries.
These records may contain valuable information about your ancestor, such as name, birthplace, residence, father’s name, and other biographical details.
The Family History Library has very few Scottish school records, but there are some records for larger cities such as Edinburgh and Glasgow. You can find school records in the Place Search of the 
SCOTLAND - SCHOOLS SCOTLAND
[COUNTY] - SCHOOLS SCOTLAND
[COUNTY], [CITY or PARISH] - SCHOOLS