sysdtssteplog stepexecresult stepexecstatus values to monitor a DTS package

I have written a DTS package and will be monitoring it via this table but would like to know the different values for stepexecresult and stepexecstatus in the msdb..sysdtssteplog table.  Can anyone advise.

LVL 5
NetstoreAsked:
Who is Participating?
 
Eugene ZCommented:
from
http://www.sqlservercentral.com/forums/printtopic.aspx?forumid=23&messageid=166060
 CASE dsl.stepexecstatus
         WHEN 1 THEN 'DTSStepExecStat_Waiting'
         WHEN 2 THEN 'DTSStepExecStat_InProgress'
         WHEN 3 THEN 'DTSStepExecStat_Inactive'
         WHEN 4 THEN 'DTSStepExecStat_Completed'
     END AS [Step Execute Status]
   , CASE dsl.stepexecresult
         WHEN 0 THEN 'DTSStepExecResult_Success' --EZ completed
         WHEN 1 THEN 'DTSStepExecResult_Failure'


---

open up dts in designer and right click in white space and choose package properties from the resulting menu. Then click on the logging tab and check the log package to sql server option and close dialogue and save package.

 

When the package runs again (and fails) run this script (got from this site) and change the package name to your package name.

USE msdb


DECLARE @package_name sysname

SET @package_name = 'YourPackageName'

SELECT
   dsl.stepname AS [Step Name]
   , CASE dsl.stepexecstatus
         WHEN 1 THEN 'DTSStepExecStat_Waiting'
         WHEN 2 THEN 'DTSStepExecStat_InProgress'
         WHEN 3 THEN 'DTSStepExecStat_Inactive'
         WHEN 4 THEN 'DTSStepExecStat_Completed'
     END AS [Step Execute Status]
   , CASE dsl.stepexecresult
         WHEN 0 THEN 'DTSStepExecResult_Success'
         WHEN 1 THEN 'DTSStepExecResult_Failure'
     END AS [Step Execute Result]
   , dsl.starttime AS [Start Time]
   , dsl.endtime AS [End Time]
   , dsl.elapsedtime AS [Elapsed Time]
   , dsl.progresscount AS [Row Count]
   , dsl.errorcode AS [Error Code]
   , dsl.errordescription AS [Error Description]
FROM
   dbo.sysdtspackagelog dpl
   INNER JOIN dbo.sysdtssteplog dsl
      ON dpl.lineagefull = dsl.lineagefull
WHERE
   dpl.logdate = (SELECT
                     MAX(dpl1.logdate)
                  FROM
                     dbo.sysdtspackagelog dpl1
                  WHERE
                     dpl1.name = dpl.name)
   AND dpl.name = @package_name
ORDER BY
   dpl.starttime

 
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.