Nhãn hiệu của chúng tôi

Impact-Company-Logo-English Black-01-177x54

Chào mừng bạn đến với Trang web của Schneider Electric

Chào mừng đến với trang web của chúng tôi.
		
Hôm nay chúng tôi có thể giúp gì cho bạn?
How to Obtain All SQL Server Jobs Details

Issue
How to obtain all the details of all SQL Jobs created on a SQL server instance.

Product Line

ION Enterprise 6.0. x

Struxureware Power Monitoring 7.0.x
Power Monitoring Expert 7.2.2
Power Monitoring Expert 8.2
Power Monitoring Expert 9.0



Environment
SQL Server 2005, SQL Server 2008 R2, SQL Server 2012, SQL Server 2014, SQL Server 2016, SQL Server 2017

Cause
For daily monitoring purposes or for troubleshooting SQL job issues, obtaining information about the SQL jobs via a single query can be very useful and time saving alternative method.

Resolution
*Warning: Irreparable database damage can occur. This procedure should only be performed by users familiar with SQL Server Management Studio. Databases should be backed up prior to performing this procedure.*

This query will provide the sql server job details for all jobs present.  It will provide job name, job status, Last run date of job & job execution status (failed or successful)
It may also be modified to add or change the fields reported as per requirement.

To obtain these job details, log into SQL Server Management Studio and run the attached SQL script (SQL_Job_Details.sql).
Alternatively, execute the query(s) below:

Use msdb 
go 
select distinct j.Name as "Job Name", --j.job_id, 
case j.enabled  
when 1 then 'Enable'  
when 0 then 'Disable'  
end as "Job Status", jh.run_date as [Last_Run_Date(YY-MM-DD)] ,  
case jh.run_status  
when 0 then 'Failed'  
when 1 then 'Successful'  
when 2 then 'Retry' 
when 3 then 'Cancelled'  
when 4 then 'In Progress'  
end as Job_Execution_Status 
from sysJobHistory jh, sysJobs j 
where j.job_id = jh.job_id and jh.run_date =   
(select max(hi.run_date) from sysJobHistory hi where jh.job_id = hi.job_id ) -- to get latest date 

Schneider Electric Việt Nam

Phần đính kèm
SQL_Job_Details.sql [566 Bytes]
Tìm hiểu thêm
Phạm vi:
Tìm hiểu thêm
Phạm vi:

Bạn cần trợ giúp?

  • Công cụ chọn sản phẩm

    Nhanh chóng và dễ dàng tìm được sản phẩm và phụ kiện phù hợp cho các ứng dụng của bạn.

  • Nhận báo giá

    Bắt đầu gửi yêu cầu bán hàng trực tuyến và chuyên gia sẽ liên hệ với bạn.

  • Nơi mua hàng?

    Dễ dàng tìm nhà phân phối Schneider Electric gần bạn nhất.

  • Trung tâm Hỗ trợ

    Tìm sự hỗ trợ cho mọi nhu cầu của bạn tại một nơi.

  • Tài liệu về Sản phẩm
  • Tải xuống phần mềm
  • Công cụ chọn Sản phẩm
  • Thay thế và thay đổi sản phẩm
  • Trung tâm Hỗ trợ
  • Tìm Văn phòng của chúng tôi
  • Nhận báo giá
  • Tìm Nhà Phân phối
  • Cơ hội nghề nghiệp
  • Hồ sơ doanh nghiệp
  • Báo cáo hành vi sai trái
  • Khả năng truy cập
  • Phòng tin tức
  • Nhà đầu tư
  • EcoStruxure
  • Tìm việc
  • Blog
  • Chính sách bảo mật
  • Thông báo về Cookie
  • Điều khoản sử dụng
  • Change your cookie settings