Technical Article

Get back list of failed dts packages

,

This is a fairly basic script that gets back a list of steps within dts packages that failed within the last 24 hours.

The reason I wrote this script, is that if you call a dts package from a dts package on another server via a scheduled job on that same server, both the package and the job show as successful even if the package fails.

Hence, scripts that I use to check jobs on both servers do not indicate any errors occurred.

This particular script brings back the steps that have failed rather than just the package name. Hitherto, if you have a dts package with multiple steps that continue on failure, you get to see all the steps that failed within the package.

You can include extra information such as the error code if you so wish.

SELECT packlog.name as packagename, 
       packlog.starttime as runtime
FROM   sysdtspackagelog packlog,
       sysdtssteplog steplog
WHERE  packlog.lineagefull = steplog.lineagefull
AND    isnull(steplog.errorcode,0) <> 0
AND    packlog.starttime > getdate()-1

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating