“Fail Safe” is episode seventeen of season five of Stargate SG-1.
An amateur astronomer detects a 137 km asteroid heading towards the Earth, on a path outside the plane of the ecliptic, and so not where the vast majority of the objects in the Solar System are. As such, it was unlikely to be detected. At least, unlikely to be detected anything remotely far enough in advance
SGC get called in to try and stop the asteroid or, in a bit over 11 days, all life on Earth will be wiped out. With an asteroid of that size, wiped out is going to be a massive understatement. Why do they always use such massively unnecessary asteroids, when one 1 km in diameter will do for wiping out most of humanity, and one ten times that size would likely sterilise the planet down to the bedrock? This is the sort of asteroid that gives an Earth-shattering kaboom.
With the Asgard prohibited from helping with natural disasters, thanks to their treaty with the Goa’uld, the Tok’ra in retreat, and the Tollan being destroyed by an unknown Goa’uld (Anubis?) in “Between Two Fires”, SG-1 have to find some way of diverting the asteroid using only their own technology. Not everything is what it seems of course.