There are six possible endings for Dragon Age: Origins.
If you side with the templars, you'll be able to kill the archdemon, but at the cost of all the Circle mages being killed and the Grey Wardens being disbanded.
If you side with the mages, you'll be able to kill the archdemon, but at the cost of the templars being disbanded and the Circle of Magi being destroyed.
If you negotiate a peace between the templars and the mages, you'll be able to kill the archdemon, but the Grey Wardens will be dissolved and you'll be exiled from Ferelden.
If you let the archdemon live, it'll possess the body of the Grey Warden Alistair and the two of you will rule Ferelden together.
If you kill the Grey Wardens, you'll be able to kill the archdemon, but Ferelden will be left defenceless and the darkspawn will overrun the country.
If you refuse to make the Grey Warden sacrifice, you'll be able to kill the archdemon, but the Grey Wardens will be disbanded and you'll be exiled from Ferelden.