简体   繁体   English

如何在火灾中忘记C#中的SQL代理中的作业

[英]how to fire job in sql agent in c# in a fire and forget manner

We have a ssis pkg that takes 20 mins to complete. 我们有一个SSIS PKG,需要20分钟才能完成。 (generates a xl report). (生成XL报告)。 Users had requested ability to control this pkg via params so we have winforms/c# gui that runs the pkg. 用户要求通过参数控制此pkg的能力,因此我们拥有运行pkg的winforms / c#gui。 (Direct from sql server. We basically call a stored proc that starts a sql job that runs the ssis pkg). (直接从sql服务器。我们基本上调用一个存储的proc,该proc启动运行ssis pkg的sql作业)。 So far so good. 到现在为止还挺好。 Now users want to log off after submitting the report request since it does not make sense to wait for 20 mins. 现在,用户希望在提交报告请求后注销,因为等待20分钟没有意义。 (we use citrix vdi. Users loginto specific vdi depending on the apps they want to use, do their tasks and logoff). (我们使用citrix vdi。用户登录到特定的vdi,具体取决于他们要使用的应用程序,执行任务并注销)。 We are 90% there and just for this functionality service broker seems to be an overkill. 我们在那里有90%,对于这个功能服务经纪人来说似乎太过分了。 I checked with our dba and we have never used service broker till now. 我与我们的dba进行了核对,到目前为止,我们从未使用过服务代理。 Is there someway I can get the ssis pkg to run even if the user closed the winforms app and logged off. 有什么办法可以使ssis pkg运行,即使用户关闭了winforms应用程序并注销了它。 (basically sql connection is lost but the fired ssis pkg on sql server must continue to run to completion). (基本上,SQL连接丢失,但是在SQL Server上发射的SSIS PKG必须继续运行才能完成)。 thanks 谢谢

we can do like this add package in job call proc and leave it will run 我们可以像在作业调用proc中那样添加程序包,并使其运行

CREATE proc startjob
AS
begin
EXEC dbo.sp_start_job N'Weekly Sales Data Backup'
END

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

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