The English-Scottish border , sometimes referred to as the Scottish–English border (or Anglo-Scottish border (known locally as simply The Border)) is the official border and mark of entry between Scotland and England. It runs for 96 miles (154 km) between Marshall Meadows Bay on the east coast and the Solway Firth in the west. It is Scotland's only land border. England shares a longer border with Wales.
Although it had long been the de facto border, it was legally established in 1237, by the Treaty of York between England and Scotland, with the exception of the Debatable Lands (Wikipedia page), north of Carlisle, and a small area around Berwick, which was taken by England in 1482.
More information on the Wikipedia page Anglo-Scottish border