Job History

  • Hi Is there a way to increase the job history in SQL Agent for a one specific job?

    I need to store job history for on e job. Right now I get only the most previous run.

  • I'm not sure if it could be done for one particular job but you can check "SQL Server AGent Properties" and then going to HISTORY tab.

  • Wo do it programatically be executing a post install script on every SQL Server installation. You can review the text of the sp_set_sqlagent_properties in MSDB for more details.

    @jobhistory_max_rows INT = NULL, -- No maximum = -1, otherwise must be > 1

    @jobhistory_max_rows_per_job INT = NULL, -- 1 to @jobhistory_max_rows

    This will set the maximum number or rows in the table to 100,000 and the maximum number of rows for any job to 1000.

    -- Increase the default size of the sql agent job history

    USE [msdb]

    GO

    EXEC msdb.dbo.sp_set_sqlagent_properties

    @jobhistory_max_rows=100000,

    @jobhistory_max_rows_per_job = 1000

    GO

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply