Fortunately, a primary stabbing headache typically lasts only seconds to a minute or so. They are more common in patients with migraines and often respond to the prescription anti-inflammatory medication indomethacin or the hormonal food supplement melatonin.