The incident happened when Mark Spragg was stopped by staff at Iceland, Harlescott Retail Park, Shrewsbury, after he was spotted leaving with a bottle of gin he had not paid for on March 15.
When he is released from prison he will be banned from entering the store or its car park for five years.
Spragg initially denied causing assault occasioning actual bodily harm but changed his plea to guilty on the basis that he did not deliberately stab the victim.
In a victim impact statement, read aloud in court, Jason Davies stated: “I was worried about this for two weeks while I waited for the results. The hospital rang me to say everything was OK.”
Prosecuting barrister Miss Suzanne Francis said Spragg stated: “I didn’t deliberately stab Jason Davies. Whilst I was running away I took the needle from the end of the syringe.
"The staff got on top of me on the floor and pulled the coat over my head. Whilst this was happening Jason Davies was pricked.”
Spragg, of Cunnery Road, Church Stretton, also admitted possession of a bladed article relating to the needle and theft of gin on the same date.
Mitigating for Spragg, Mr Brendan Reedy, solicitor advocate, said Spragg, a fork-lift driver, stole the gin during a period when there was a mix-up over his methadone prescription.
The court also heard that the following day he attempted to smuggle a mobile telephone into HMP Hewell, in Worcestershire and was arrested. And he also admitted conveying a prohibited item into a prison.
His latest offences breached a 16-month sentence suspended for 24 months which he received on December 21 last year for possession with intent to supply cocaine in Shrewsbury.
Judge Anthony Lowe activated the suspended jail term at the hearing and jailed the father-of-two for a total of 32 months for the offences.
He was also found not guilty following a trial after he was accused of assaulting a woman at a property in Oswestry on June 6 last year.
He must serve half the term minus time already spent in custody on remand since his latest arrest. The court ordered of the forfeiture and destruction of the confiscated needle and phone.