Russell Irvine, 32, and Helen Paterson, 33, tried to rob Royal Mile Pharmacy in Edinburgh's High Street on May 15.
The pair wielded Stanley knives and threatened staff and customers while attempting to steal medication from the shop.
Police forced entry to the pharmacy following a three-hour siege and used a stun gun to temporarily disable Irvine.
Irvine and Paterson later pleaded guilty to abduction, assault and robbery.
A judge at the High Court in Aberdeen jailed Irvine for six years and sentenced Paterson to five years.
They will each spend a further five years on licence following their release.
Judge Lord Doherty said: "This was a terrifying and prolonged ordeal for those whom you abducted and assaulted. A major police operation had to be implemented to deal with the emergency which you created.
"There is no escaping that you have each committed a very grave crime.
"Those who work in pharmacies must be able to carry on their work without being subjected to violence or threats of violence. Their safety and the safety of ordinary members of the public using pharmacies has to be protected."
Irvine and Paterson entered the shop at around 6pm and prevented staff and customers from leaving.
Workers are said to have been traumatised by the robbery attempt, during which Paterson collapsed and had to be treated in hospital.
Chief Inspector Bob Paris said: "Russell Irvine and Helen Paterson subjected the staff and patrons within the pharmacy to a terrifying ordeal which lasted a number of hours before police could bring a safe conclusion to the incident.
"Whatever the motives for their actions were, the distress and fear they caused their victims was inexcusable and the sentences handed to them today are a reflection of how seriously police and Crown Office view incidents like this.
"I sincerely hope all of those who were detained by Irvine and Paterson within the pharmacy can now put the matter firmly behind them."