My most important production server uses Change Data Capture (CDC) a lot, maybe for about 25 tables. The relevant agent job shows well over 1,000 steps as in progress. Because they are in progress, they do not respect the option in SQL Server Agent's GUI called "Maximum job history rows per job". They do respect the other setting in that same GUI, "Maximum job history log size (in rows)". However, increasing this setting by several thousand has not been enough to cure this problem. How, then, can I make CDC stop capturing a seemingly infinite amount of agent job history?
My only idea so far has been to write a custom script to wipe the records of CDC jobs that are currently in progress. Given that the jobs are currently in progress, this seems like a stupid and dangerous idea.
I must assume that this is a solved problem. CDC is from something like 2008 and SQL Server Agent is ancient. Failure to solve this problem will leave me without agent job history for a lot of my jobs.