delete the records from sysjobhistory table in msdb

  • how can i delete the records from sysjobhistory table in msdb

    which is older than 30 days.can u pls tell me the query to do this

  • That's useful information. Why do you want to delete it ? Most of the time the question is about getting more history info, not less.

  • Right click agent, choose properties. There's a history tab. You can limit by rows or size, and remove history older than xx days.

  • You can also do the same in TSQL by executing sp_delete_backuphistory

  • That's useful information. Why do you want to delete it ? Most of the time the question is about getting more history info, not less.

    I agree that is useful Information but some servers have too much of information about these and I have seen many Managers saying the last 4 weeks Data be suffice.

    Another way doing this is having a Maintenance Plan and have Clean History task delete it for you.


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • Ian Scarlett (10/30/2009)


    You can also do the same in TSQL by executing sp_delete_backuphistory

    is this Stored procedure used to delete the history of jobs?????

  • Steve Jones - Editor (10/30/2009)


    Right click agent, choose properties. There's a history tab. You can limit by rows or size, and remove history older than xx days.

    i am using sql server 2000...there is no option to remove the history o;lder than XX days..i think it is avai;lable in 2005

  • Bru Medishetty (10/30/2009)


    That's useful information. Why do you want to delete it ? Most of the time the question is about getting more history info, not less.

    I agree that is useful Information but some servers have too much of information about these and I have seen many Managers saying the last 4 weeks Data be suffice.

    Another way doing this is having a Maintenance Plan and have Clean History task delete it for you.

    I think that answer was a mistake.

  • shanila_minnu (10/30/2009)


    Ian Scarlett (10/30/2009)


    You can also do the same in TSQL by executing sp_delete_backuphistory

    is this Stored procedure used to delete the history of jobs?????

    No, it's not... ignore me, I got my wires crossed:Whistling:

  • homebrew01 (10/30/2009)


    Bru Medishetty (10/30/2009)


    That's useful information. Why do you want to delete it ? Most of the time the question is about getting more history info, not less.

    I agree that is useful Information but some servers have too much of information about these and I have seen many Managers saying the last 4 weeks Data be suffice.

    Another way doing this is having a Maintenance Plan and have Clean History task delete it for you.

    I think that answer was a mistake.

    Hey homebrew01, That answer is not a mistake, I request you check before saying that its a mistake, Please take a took at the Image attached.

    Does that not show it is a History Cleanup Task and is it not Maintenance Plan????


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • I meant to quote that running sp_delete_backuphistory was a mistake ..... So I was mistaken about mistakes ..... ooops....:blush:

  • Ok got it..

    You know what? The irony is the question was meant to be posted in SQL 2000 and the by mistake the user posted has posted in SQL 2005 Forum.. 🙂

    Any way if it help some one else thats job done


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

Viewing 12 posts - 1 through 11 (of 11 total)

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