从脚本触发 Integration Services 事件时,我偶然发现了 Microsoft.SqlServer.Dts.Tasks.ScriptTask.EventsObjectWrapper Dts 属性(Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase)中的 FireInformation 方法。最后一个参数 fireAgain 通过引用传递。 documentation解释说:“继续射击为真;否则为假。”为什么要通过引用传递参数?是否存在该方法将值设置为 true 并要求调用者重复调用的条件?如果调用者将该值设置为 false,会产生什么影响?
最佳答案
FirstInformation 提供抑制进一步事件的机制的原因是成本。引发事件的成本可能很高,并且根据定义,这些消息本质上是信息性的,因此允许日志提供程序或自定义任务停止引发事件是有意义的。
来自IDTSComponentEvents.FireInformation Method
Because firing of an event may be expensive, the run-time engine provides a mechanism for suppressing events that you are not interested in. Every event firing method has a FireAgain parameter. If the value of this variable is false, after the method returns, the caller will not fire this event again for the duration of the current execution.
关于sql-server - Dts.Events.FireInformation 方法中的 fireAgain 参数的用途是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26510450/