查詢 SQL Job 正在執行的狀態

雖然 http://stackoverflow.com/questions/18445825/how-to-know-status-of-currently-running-jobs 提供以下的查詢

SELECT sj.name,sj.*
   , sja.*
FROM msdb.dbo.sysjobactivity AS sja
INNER JOIN msdb.dbo.sysjobs AS sj ON sja.job_id = sj.job_id
WHERE sja.start_execution_date IS NOT NULL
   AND sja.stop_execution_date IS NULL

exec   sp_help_job @job_name=’test’

但我需要知道 job 實際叫起的 dtexec 之 pid,畢竟同時有一堆 SSIS Job 在執行,無法知道哪個 job 是對應到哪個 windows 上正在 run 的 dtexec process,不知大家有何解法…用 script task 自己取得 pid 存進 log 嗎?

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

%d 位部落客按了讚: