SQL Server:如何在两次之间暂停预定作业?

时间:2022-07-17 02:11:51

Is there a way to pause a scheduled job in SQL Server to NOT run between two times a day?

有没有办法暂停SQL Server中的预定作业,不能每天运行两次?

I have a recurring job that starts every 2 hours, daily from 12am. However, I want the job to not run between 4pm and 6pm. So I want it to run as follows:

我的工作每2小时开始一次,每天从早上12点开始。但是,我希望这项工作不会在下午4点到6点之间运行。所以我希望它运行如下:

12am, 2am, 4am, 6am, 8am, 10am, 12pm, 2pm, 8pm, 10pm and back to midnight.

上午12点,凌晨2点,凌晨4点,早上6点,早上8点,上午10点,下午12点,下午2点,晚上8点,晚上10点,然后回到午夜。

Is that possible?

那可能吗?

Thanks

1 个解决方案

#1


1  

I'm afraid you have to split your job in two schedules (12am to 4pm and 6pm to 10pm). You can handle this by implementing your own scheduling with a data model and some stored procedures. Hope it helps.

我担心你必须按照两个时间表(上午12点到下午4点和下午6点到晚上10点)分配你的工作。您可以通过使用数据模型和一些存储过程实现自己的调度来处理此问题。希望能帮助到你。

Kind Regards,

#1


1  

I'm afraid you have to split your job in two schedules (12am to 4pm and 6pm to 10pm). You can handle this by implementing your own scheduling with a data model and some stored procedures. Hope it helps.

我担心你必须按照两个时间表(上午12点到下午4点和下午6点到晚上10点)分配你的工作。您可以通过使用数据模型和一些存储过程实现自己的调度来处理此问题。希望能帮助到你。

Kind Regards,