https://en.wikipedia.org/wiki/United_States_Uniformed_Services_Oath_of_Office
There are different oaths for different offices.
All officers of the seven uniformed services of the United States swear or affirm an oath of office upon commissioning. It differs slightly from that of the oath of enlistment that enlisted members recite when they enter the service. It is required by statute, the oath being prescribed by Section 3331, Title 5, United States Code.[1] It is traditional for officers to recite the oath upon promotion but as long as the officer's service is continuous this is not required
https://en.wikipedia.org/wiki/United_States_Armed_Forces_oath_of_enlistment
(a) Enlistment Oath.— Each person enlisting in an armed force shall take the following oath:
"I, (state name of enlistee), do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; and that I will obey the orders of the President of the United States and the orders of the officers appointed over me, according to regulations and the Uniform Code of Military Justice. So help me God."
For officers and office holders:
I, [name], do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; that I take this obligation freely, without any mental reservation or purpose of evasion; and that I will well and faithfully discharge the duties of the office on which I am about to enter. So help me God
Senators:
do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; that I take this obligation freely, without any mental reservation or purpose of evasion; and that I will well and faithfully discharge the duties of the office on which I am about to enter: So help me God.
https://www.law.cornell.edu/uscode/text/5/3331
5 U.S. Code § 3331 - Oath of office
An individual, except the President, elected or appointed to an office of honor or profit in the civil service or uniformed services, shall take the following oath: “I, AB, do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; that I take this obligation freely, without any mental reservation or purpose of evasion; and that I will well and faithfully discharge the duties of the office on which I am about to enter. So help me God.” This section does not affect other oaths required by law.