all groups > sql server dts > september 2003 >
You're in the

sql server dts

group:

Automatically delete oldest PackageLogs


Automatically delete oldest PackageLogs Yelena
9/30/2003 9:12:36 AM
sql server dts: I have a DTS package that executes every 10 min. How can I
create automated way to remove oldest PackageLogs from SQL
server?

Thank you,

Yelena
Re: Automatically delete oldest PackageLogs Darren Green
10/1/2003 3:47:25 PM
The SQL Server based logs are held in three tables within the msdb database-

dbo.sysdtspackagelog
dbo.sysdtssteplog
dbo.sysdtstasklog

The relationship between the three is fairly obvious, but you only need
delete from sysdtspackagelog a there are FKs with the cascading delete
option set for the other two tables. Sample code-

DELETE dbo.sysdtspackagelog
WHERE logdate < DATEADD(hh, -24, CURRENT_TIMESTAMP)


--
Darren Green
http://www.sqldts.com


[quoted text, click to view]

AddThis Social Bookmark Button