Unending

"Unending" is the twentieth episode of the tenth season of Stargate SG-1 and is the last episode of the series.

Plot
The Asgard contact Stargate Command to tell them to rendezvous at the Asgard homeworld, because they have news of great importance to share. During the boring journey, Vala arranges a surprise birthday party for Daniel, to which he responds with annoyance—since it is not his birthday (and she is only trying to alleviate her own boredom).

SG-1 and General Landry travel on Odyssey to the Asgard home world of Orilla. They are greeted by Thor, who announces that Earth will be given a complete Asgard database and central computer, as well as several extremely advanced upgrades, including weapons and shields. Thor explains that the Asgard's final attempt to fix their inherent gene degradation was a failure, and as a result the entire Asgard race has contracted a terminal illness. The damage from years of such experiments is so severe that they are unable to ascend. However, rather than allowing themselves to slowly die out and have their technology plundered, the Asgard people have decided to give their most sophisticated technology and their entire knowledge base to the Tau'ri, whom Thor finally calls the "fifth race", before they will commit an act of mass suicide.

As the final installations are completed, three Ori motherships exit hyperspace and attack Odyssey. The Asgard beam off the ship, and Odyssey flees. One Ori ship follows, the others turning on the Asgard. However, the Asgard destroy their own planet, wiping themselves out. With the Odyssey ' s shields damaged and the hyperdrive temporarily unusable because of the planet's destruction, General Landry orders that they come about and use the new, untested weapons. This succeeds in penetrating the shields of the Ori mothership and destroying it.

After entering hyperspace, Colonel Carter discovers some strange readings from the new hyperdrive system, and suggests that they stop using it. Immediately after exiting hyperspace, two more Ori battlecruisers emerge. After quickly re-entering hyperspace, Carter realizes that the Ori battlecruisers are tracking the energy signature of the Asgard-modified propulsion system. With no alternative, General Landry orders them to head for the nearest planet with an active Stargate and off-load Odyssey ' s crew.

SG-1 and General Landry remain on board as Carter tries to disconnect the hyperdrive from the Asgard computer core, which she hoped would prevent the Ori from tracking the ship. The process is time-consuming, and the Ori ships quickly catch up to resume the attack. Odyssey takes several beam shots to the shields causing increasing reflexive damage, and General Landry orders that Odyssey ' s fire be concentrated on only one target. The Asgard energy weapons penetrate the Ori mothership's shields, inflicting serious damage. Odyssey's shields fail as a final beam is sent out by the remaining Ori ship. However, before the beam makes contact, Carter activates a time dilation field around the ship—one of the new features of the Asgard technology.

Within the time dilation field, time passes in such a way that years may go by while fractions of a second pass by outside the field. Safe for the time being, Carter is able to work on several theories to allow the team to leave Odyssey before the beam hits, or to jump the ship out of phase before the beam makes contact. However, all of her simulations produce the same result: the destruction of the ship, the death of all on board, and the loss of all of the Asgard's knowledge. Stuck until they are able to figure out a new solution, SG-1 prepares for a long wait. With a ZPM and the Asgard power core to power the time dilation field and the new Asgard technology synthesizing food, supplies and oxygen, they are able to live on the ship indefinitely.

During their initial months on board, Vala repeatedly tries to seduce Daniel, while he continues to repel her advances. Finally, after three months, Daniel angrily confronts Vala for what he believes to be her insincerity, teasing, and mocking of him. He says they could never have a serious romantic relationship, that he couldn't even imagine them having one, and did not believe she ever thought of them seriously having a relationship. Vala is greatly upset by his words, making him realize that she really does care for him and was sincere. They share a passionate embrace. The next scene sees a somewhat disheveled Vala leaving Daniel's cabin as Mitchell jogs past, seemingly nonplussed at the sight.

Vala volunteers to help Sam, hypothesizing that they could reverse time in the field up to the point they left the Asgard home world, and then disable the hyperdrive—but Sam rules this out as impossible.

Years pass, as each member of the team attempts to deal with their isolation. Landry develops a gardening hobby; Carter learns how to play the cello; Daniel continues to work on translating information in the database; Teal'c trains; and Daniel and Vala develop their relationship. Mitchell spends much time jogging through the ship, growing more frustrated and angry as the years pass. Scenes show him wrecking his cabin, and sitting in a 302, contemplating escape (which would be followed by quick death). He and Teal'c train together. In another scene, Daniel holds a crying Vala. After many years, General Landry succumbs to old age and dies. Teal'c changes very little, except for a small gray streak in his hair.

After fifty years, with everybody besides Teal'c aging greatly, Sam finally figures out how to reverse time within a localized field. By reversing time back to slightly before the point of dilation, they can stop the program being activated and use a new program Sam has written onto a crystal to quickly disconnect the Asgard computer core from the hyperdrive in seconds. Unfortunately, in a last, cruel irony, the ship's power supplies no longer have enough energy to complete the plan, due to the constant drain of maintaining the time dilation field over decades.

However, Mitchell directs Sam's attention to the Ori energy beam; he theorizes that by deactivating the dilation field and allowing the beam to hit, they can channel the beam's power to the core. The dilation field would reverse, and they would go back in time; everything would be undone. However, there are two problems. First, the ship will be destroyed by the blast, and if the time reversal does not activate quickly enough, the destruction will not be reversed. Second, the reversal of the time field will mean the loss of any memories of what happened over the past fifty years. One person will have to remain behind, protected within a separate field, staying aged so as to retain the memories necessary to perform the rescue. Teal'c, who as a Jaffa has a much longer lifespan than the other members of the team, volunteers. As the group prepares their plan, Vala and Daniel exchange a last embrace, assuring each other of their love. When everything is in place, they deactivate the time dilation field.

As the ship explodes around Teal'c, time begins to slow, stop and finally reverses. The ship re-forms, the beam withdraws, and time is re-set. Teal'c prevents Carter from activating the time dilation field and gives her the control crystal that disconnects the Asgard computer core from the hyperdrive. They leave before they are destroyed, saving themselves and the Asgard's legacy.

Back at the SGC, Teal'c refuses to reveal any of the events on the ship to the others, much to Vala's disappointment. However, Daniel jokes that Teal'c revealed to him several bits of good advice that Daniel read in the Asgard database in the alternate timeline, but they're really just common aphorisms. SG-1 contemplates these words of wisdom—among them "life is short"—as they prepare for another mission. As the episode—and the series—comes to a close, the team says "indeed" all at once, General Landry wishes the team God-speed, and SG-1 steps through the gate on their next mission.

Quotes
Thor: "You are the Fifth Race. Your role is clear. If there is any hope in preserving the future, it lies with you and your people."

Carter: NO pressure huh.

Daniel: I mean, all they wanted to do was live a little longer. We're no different. Sequence DNA. Cure diseases. One fatal mistake, and they doom their entire race. I guess no matter what you do, at the end of the day…life is too short.