February 27, 2006 at 4:29 am
hi everybody
i tried to schedule a job for an asp page using a sp that i've created.
in my sp i use sp_update_jobschedule but the result is:
job schedule is correctly updated but it is not enabled
if i try from query analyzer work correctly
can yuo help me?
this is a part of my sp
EXEC msdb.dbo.sp_update_jobschedule
@job_name = @JobName,
@name = @ScheduleName,
@active_start_date = @Start_date,
@active_start_time = @Start_time,
@enabled = 1
bye
(yuo are great!!!)
February 27, 2006 at 12:20 pm
have you checked the jobschedule status with
sp_help_jobschedule ?
February 28, 2006 at 8:25 am
Hmmmm. I just did some preliminary tests with sp_update_jobschedule, and it would not change the status of the job either way. Alternatively, you could access the enabled column directly:
DECLARE @myJob sysname
SET @myJob = '<name of job>'
-- Show job info
SELECT enabled
, job_id
, name
FROM msdb..sysjobs
WHERE name = @myJob
-- Enable job
UPDATE msdb..sysjobs
SET enabled = 1
WHERE name = @myJob
-- Disable job
UPDATE msdb..sysjobs
SET enabled = 0
WHERE name = @myJob
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply