This rhetorical question is used to rebuke David. This can be written as a statement. AT: "You should not have despised ... Yahweh and should not have done what is evil in his sight!" (See: [[rc://en/ta/man/translate/figs-rquestion]])
Here "sight" refers to Yahweh's thoughts or opinion. AT: "what he considers to be evil" or "what is evil in Yahweh's judgement" (See: [[rc://en/ta/man/translate/figs-metaphor]])
David did not kill Uriah himself, rather he arranged for him to be killed in battle. The phrase "with the sword" represents how Uriah died in battle. AT: "You have arranged for Uriah the Hittite to die in battle" (See: [[rc://en/ta/man/translate/figs-metonymy]])
# You killed him with the sword of the army of Ammon
David did not kill Uriah himself, rather he arranged for him to be killed in battle when Israel was fighting against Ammon. The phrase "with the sword" refers to how he died in battle. AT: "You arranged for him to die in battle against the army of Ammon" (See: [[rc://en/ta/man/translate/figs-metonymy]])