1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| use tempdb
GO
create table guest.getAgentsInfo
(job_id uniqueidentifier NOT NULL,
last_run_date INT NOT NULL,
last_run_time INT NOT NULL,
next_run_date INT NOT NULL,
next_run_time INT NOT NULL,
next_run_schedule_id INT NOT NULL,
requested_to_run INT NOT NULL,
request_source INT NOT NULL,
request_source_id sysname COLLATE database_default NULL,
running INT NOT NULL,
current_step INT NOT NULL,
current_retry_attempt INT NOT NULL,
job_state INT NOT NULL)
GO
INSERT INTO guest.getAgentsInfo EXECUTE master.dbo.xp_sqlagent_enum_jobs 1,garbage
GO |
Partager