How to increase in TSQL the value for "Maximum job history rows per job" and "Maximum job history log size"

  • [font="Times New Roman"]Hello,

    I'm looking for the way to change default values for those two option in SQL Server Agent Properties :

    Maximum job history log size : default to 1000

    Maximum job history row per job : default to 100

    And because I want to script those values I don't want to change it in EM but by using QA

    I don't find any SP to change it and I don't know WHERE these default values are stored (which table ?).

    Di someone could help me ??

    Many thanks

    Philippe[/font]

  • Le Rhun Philippe (8/7/2008)


    [font="Times New Roman"]Hello,

    I'm looking for the way to change default values for those two option in SQL Server Agent Properties :

    Maximum job history log size : default to 1000

    Maximum job history row per job : default to 100

    And because I want to script those values I don't want to change it in EM but by using QA

    I don't find any SP to change it and I don't know WHERE these default values are stored (which table ?).

    Di someone could help me ??

    Many thanks

    Philippe[/font]

    USE [msdb]

    GO

    EXEC msdb.dbo.sp_set_sqlagent_properties @jobhistory_max_rows=2000,

    @jobhistory_max_rows_per_job=200

    GO

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • Many thanks Andras,

    I haven't seen this SP in BOL. The next time I'll search more in msdb to find an answers.

    Regards

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

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