如何在触发器中执行安装在SQL Server中的SSIS包 [英] How to execute SSIS package installed in SQL Server in trigger

查看:91
本文介绍了如何在触发器中执行安装在SQL Server中的SSIS包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在SQL Server商业智能开发Studio中创建了SSIS包。
如果在该软件包中运行该软件包,则该软件包可以正常工作,因此我部署了该软件包。

I have created SSIS package in SQL Server Business Intelligence Development Studio. The package works fine if I run it there, so I deployed the package.

然后,我使用软件包安装向导并将其安装在本地SQL Server上2005。

Then I used the package installation wizard and installed it on a local SQL Server 2005.

现在我想在触发器中使用它。

Now I want to use it in my trigger.

我知道如何从文件,但是在SQL Server中安装该文件时如何执行呢?

I know how to execute a package from file, but how to I execute it when it is installed in SQL Server?

谢谢。

推荐答案

正如我之前提到的:我不会将这样的任务放入触发器。由于您无法控制何时触发触发器以及触发触发器多少次,因此在执行时间方面,触发器中的任何内容都应该非常短。 不要将长时间运行的处理放入触发器!

As I mentioned before: I would not put such a task into a trigger. Since you cannot control when and how many times the trigger is fired, anything in the trigger should be very short in terms of execution time. Do not put long-running processing into a trigger!

我的方法是:


  1. 触发器将一个条目写入表(作业表或任何您想调用的表)

  1. the trigger writes an entry into a table (a "job" table or whatever you want to call it)

运行例如的任务(例如SQL Agent Job)每5分钟一班。或读取该表的任何内容,并在必要时写入文件。

a task (e.g. SQL Agent Job) that runs e.g. every 5 mins. or whatever reads that table, and if necessary, writes the file.

这将触发代码与实际写入文件的较长过程脱钩。

This decouples the trigger code from the longer process of actually writing the file.

否则,此可能运行时间很长的触发器会严重影响您的系统性能。

Otherwise, your system performance will be severely affected in a bad way by this potentially very long-running trigger....

这篇关于如何在触发器中执行安装在SQL Server中的SSIS包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆