He commanded an autonomous corps in the 1799 campaign in southwestern Germany, with which he protected the main Austrian army's right (northern) flank as it advanced across Swabia.
At the first action of this campaign, the Battle of Ostrach, he led 10,000 men across Swabia, covering the northernmost flank of the Austrian and Imperial army.
At the Battle of Wiesloch, (3 December), he drove the French from the right bank of the Rhine and relieved Philippsburg fortress.
After the Austrian defeat at Battle of Hohenlinden on 3 December 1800, Sztáray was given the task of raising the Bohemian-Moravian Legion.
He was the Colonel and Proprietor of the 33rd Infantry Regiment (Austria) from 1791 until his death on 23 January 1808.