Finding if a DTS Package is running
February 20th, 2006 // 5:37 pm @ Amar
I was stuck at finding a solution to if a DTS Package is executing or not. It could have been started with the scheduler, or started manually. The only solution to this problem which I could come up with without any code changes to the package itself, was to enable Logging to SQL Server, and then checking the state of the package in the syspackagelog table by the following query
SELECT TOP 1 endtime FROM msdb.sysdtspackagelog WHERE
name = ‘Your Package Name’ ORDER BY starttime DESC
If it returns a date, then the package is not running, and if it returns NULL, then the package is currently in executing stage.
Category : SQL Server