Sql Server Jobs Control

HKN MZ
Towards Dev
Published in
1 min readDec 24, 2023

--

This SQL query retrieves information about SQL Server Agent jobs, including details about the job, its schedule, and the recent execution history.

SELECT 
CONVERT(SYSNAME,SERVERPROPERTY('Servername')) AS Server,
job.name AS JobName,
CASE WHEN job.enabled=1 Then 'Enable' else 'Disable' END [JobUsing],
job.description,
job.date_created,
cat.name AS CategoryName,
sch.next_run_date,
sch.next_run_time,
srv.last_run_outcome…

--

--

I am writing about Sql Server, Elasticsearch and Python. İ am an Database Administrator on SQL Server and Elasticsearch more than 5+ years.