简体   繁体   English

SSIS SQL作业调度冲突

[英]SSIS SQL job scheduling conflict

I've been given the task to schedule 2 SSIS packages (by the way I'm a Jr.Data Analyst and starting to get my feet wet with SSIS). 我的任务是安排2个SSIS软件包(通过我是一名Jr.Data Analyst的方式开始让SSIS弄湿我的脚)。 Here is the scenario: I have a package that needs to be scheduled to run weekly at 1pm every Friday (this sends out files to an ouside vendor). 这种情况是这样的:我有一个软件包,需要计划在每个星期五的下午1点每周运行一次(这会将文件发送给ouside供应商)。 Will call this the weekly package. 将其称为每周套餐。 I have another package for the same vendor that needs to be scheduled to run the first friday of every month. 我为同一供应商准备了另一个软件包,需要计划每个月的第一个星期五运行。 Will call this the monthly package. 将其称为每月套餐。 So I have scheduled the weekly package to run every Friday BUT I need the weekly package not to run the Friday that the monthly package will run. 因此,我已安排每周软件包在每个星期五运行,但我需要每周软件包不要在每月软件包将运行的星期五运行。 Any ideas would be greatly appreciated. 任何想法将不胜感激。 Thank You 谢谢

添加一个运行的“执行SQL”任务:

IF (DATEPART(day,GETDATE()) BETWEEN 1 AND 7 AND DATEDIFF(day,0,GETDATE())%7 = 4) RAISERROR('Skip job on first Friday of month',16,1)

You could make it easy and schedule four jobs. 您可以轻松地安排四个作业。 Weeks 1, 2 & 3 would be the weekly package and the 4th would be the monthly package. 第1、2和3周是每周套餐,第4周是每月套餐。 SQL server agent makes it easy to do this. SQL Server代理使执行此操作变得容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM