The one-off outlay is associated with training officers, amendments to the National Stop and Search Database and the production of receipts which will be given to all those subjected to a search.
The new code, which is due to come into force in May, will end the practice of so-called “consensual search”, which allows police officers to stop members of the public and carry out a search by simply asking their permission.
Police officers will now only be able to stop and search people when they have “reasonable grounds for suspicion” based on information or intelligence received.
The Scottish Police Authority (SPA) will spend a total of £2.8m on implementing the code, the majority of which covers training for 16,850 officers and 750 special constables who will be given four hours of classroom training and a two-hour “e-learning package”.
An initial plan to give a full day of training to officers up to and including the rank of inspector would have cost £3.9m, but was abandoned.
The rest of the costs are made up of amendments to the National Stop and Search Database, which records stop-search statistics and the production of receipts which will provide information on how to obtain a copy of the record of search and provide guidance on an individual’s rights.
A Scottish Police Authority spokesman said: “Stop and search is a major element of police activity and it is important that, as we adapt the way it is carried out and evidenced, we also make sure that we support our officers in implementing it well.
“Training is a hugely important part of that process and is an investment, not just a cost.
“While policing does face financial challenges, these are fairly modest one-off sums for an organisation operating with a £1bn annual budget.”
Following controversy over stop-searches of children, Police Scotland dramatically scaled back its use of the tactic.
Figures from Police Scotland show consensual searching has reduced from 70 per cent of all searches in 2013-14 to 3.5 per cent at December 2016.
In the first nine months of 2016-17, some 2,310 children under the age of 16 were searched – including nine under 12 – but more than 90 per cent of these were done under statutory legislation.
Last month the Scottish Police Federation (SPF), which represents rank and file officers, said the new code would stop its members from operating on a “hunch”, which it described as “one of the most invaluable skills a police officer has at their disposal”.
It cited the example of what it called a “recent spate of ‘stranger rapes’” in Glasgow, saying that officers would not be able to search those acting suspiciously in the area.
In a written submission to Holyrood’s justice sub-committee on policing, Calum Steele, general secretary of the SPF, said: “It is incredible that there is no concession for the reality that suspicious behaviour is often a product of a guilty mind.”