all groups > sql server dts > june 2006 >
You're in the

sql server dts

group:

Activat(Deactivate a scheduled dts job with t-sql


Activat(Deactivate a scheduled dts job with t-sql Michel
6/29/2006 12:00:00 AM
sql server dts:
Hi

Is it possible to activate or deactivate a scheduled DTS job with a t-sql
script?

Thanks for some thoughts

Michel

Re: Activat(Deactivate a scheduled dts job with t-sql Davide
6/29/2006 5:25:05 AM

[quoted text, click to view]


Hi you could use this:


USE msdb

DECLARE @enabled int
DECLARE @jobname varchar(255)

SET @enabled = 0 --(0 to disable, 1 to enable)
SET @jobname = 'thenameofmyjob'

UPDATE sysJobSchedules
SET enabled = @enabled
FROM
(SELECT s.* FROM sysJobSchedules s
JOIN sysjobs j
ON j.job_id = s.job_id
AND j.name = @jobname
) AS sj
WHERE sysJobSchedules.job_id = sj.job_id


Note: This disable\enable all possible schedulations of the indicated
job

Bye
Re: Activat(Deactivate a scheduled dts job with t-sql Sue Hoegemeier
6/29/2006 7:02:48 PM
Check sp_update_job in SQL Server Books Online. You can
disable a job using this, something like:
EXEC sp_update_job @job_name = 'YourJobName',
@enabled = 0

-Sue

On Thu, 29 Jun 2006 11:38:19 +0200, "Michel"
[quoted text, click to view]
AddThis Social Bookmark Button