Skip to content
Advertisement

How to query SQL Server Agent – all jobs’s error message result set

Question: how to query SQL Server Agent – all jobs’ error message result set

image-20200814085131688

Input:

Expected result:

What I’ve tried & know: I know Job Activity Monitor GUI form can do it, but it only contains last run as shown in this screenshot:

image-20200814085609180

Advertisement

Answer

I searched msdn and found dbo.sysjobhistory (Transact-SQL) – SQL Server | Microsoft Docs can do it

image-20200814100930197

but it looks like only cotaining few days data.

image-20200814100844574

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement