A Hamburg man was sentenced last week to eight years in prison after he pleaded guilty to attempted murder and terroristic threatening in the first degree.