How to delete DTS package logs older than 1 month?

  • How to delete DTS package logs older than 1 month? Thanks.

  • I've used this to delete logs for a specific package:

    DELETE

    FROM sysdtspackagelog P

    WHERE logdate < 

      (SELECT DATEADD(month,-1,MAX(logdate))

        FROM sysdtspackagelog d

       WHERE p.id = d.id)

    and name = 'Refresh PR & SS'

    You'll want to delete from sysdtssteplog also.  Join it to sysdtspackagelog on lineagefull.

    Greg

    Greg

  • Take a look at sp_dump_dtspackagelog in the msdb database.

    Deleting from sysdtspackagelog will cascade to the step and task logs.

    --------------------
    Colt 45 - the original point and click interface

  • Thanks guys.

  • Thanks, Phill.  I didn't notice the referential constraints between sysdtssteplog, sysdtstasklog and sysdtspackagelog.

    Greg

    Greg

Viewing 5 posts - 1 through 4 (of 4 total)

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