April 2, 2008 at 8:06 am
How to use this store procedure to list all sql job schedule
April 2, 2008 at 8:27 am
sp_help_jobschedule returns the schedule for just one job. You'd have to query the table sysjobschedules yourself to get this information out.
April 3, 2008 at 3:18 am
Okay, I will query that table. Thanks
Any road map to learn all these type of tables and system procedures.
April 4, 2008 at 12:56 pm
USE MSDB
DECLARE @jobname VARCHAR(150)
DECLARE @string VARCHAR(250)
DECLARE job_cursor CURSOR
FOR SELECT DISTINCT name
FROM dbo.sysjobs
OPEN job_cursor
FETCH NEXT FROM job_cursor INTO @jobname
WHILE @@fetch_status = 0
BEGIN
SET @string = 'sp_help_jobschedule @job_name = [' + @jobname + ']'
EXEC (@string)
--PRINT (@string)
FETCH NEXT FROM job_cursor INTO @jobname
END
DEALLOCATE job_cursor
"Got no time for the jibba jabba!"
-B.A. Baracus
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply