A 17-year-old tried to stab his father in the heart for stealing his teenage girlfriend, a court heard.
Graham was sentenced at the High Court in Edinburgh
Sean Graham, from Hawick, was put on probation for three years and ordered to do 240 hours of community service after he admitted attempted murder.
The High Court in Edinburgh heard that his father Derek, 35, had been in a relationship with Danielle Johnstone, 17, the mother of Sean's child.
Lord Menzies said he took the case's "peculiar circumstances" into account.
At an earlier hearing, advocate depute Paul Kearney said Graham had been drinking heavily at his ex-girlfriend's house on the afternoon of 1 January.
He then began making threats against his father, saying: "I am going to stab him today."
Graham walked into his father's house shortly after midnight, walked into the living room and pulled out a knife.
"He then went straight to where his father was sitting in an armchair and struck his father on the left shoulder with the knife," said Mr Kearney.
"At that point the father managed to knock his son to the floor and the other persons present assisted in disarming the accused."
Mr Graham was taken to hospital, where he received two stitches in a minor shoulder wound.
His son, who had drunk two bottles of vodka and a bottle of Buckfast before the attack, told police that he had intended to kill his father.
When asked where he had tried to stab him, Graham said: "I was intending to do it in the heart."
The teenager added that he had "lost it" after having too much to drink, and said he would not have contemplated such an action while sober.
On Friday, the court heard that Graham had been seeking help for his drinking and wanted to patch things up with his father.
Lord Menzies told him that drinking was "no excuse".
"What you did you did with pre-meditation in that you took a knife with you from your house and went with murderous intent to assault your father," said the judge.
Passing sentence, he said he was taking into account Graham's age, his guilty plea and the fact that he was a first offender.
"Perhaps most importantly, I take account of the peculiar circumstances involving your relationship with your girlfriend - mother of your child - who then formed a relationship with your father," he said.