如何从SSIS包中禁用交互式消息框?

mer*_*kel 5 ssis batch-file

我正在命令行上执行SSIS包dtexec.exe.包调用MessageBox.Show()MsgBox()(分别为C#和VB.NET)显示错误.这些盒子挂着自动作业处理器,因为它正在等待盒子关闭.

的印象是,当不处于交互模式时,应该隐藏这些框.可以在不修改SSIS包的情况下抑制消息框吗?该软件包来自软件供应商,我真的不应该改变它.

编辑:我正在使用的完整命令(编辑删除详细信息)

C:\Program Files\Microsoft SQL Server\100\DTS\Binn\DTExec.exe /F D:\Path\To\Package.dtsx /Conn DBConnection;"Provider=SQLOLEDB;Data Source=SERVER;Initial Catalog=DB;Integrated Security=SSPI;Connect Timeout=60" \Package.Variables[User::InputFileName].Properties[Value];C:\Path\To\Input.csv
Run Code Online (Sandbox Code Playgroud)

EDIT2:消息框代码示例.这是一个脚本任务.

Public Sub Main()
    MsgBox("Failed to read/parse input file or generic database failure while running " + Dts.Variables("System::PackageName").Value.ToString() + ". Please check the layout of the feed and database connectivity.")
    Dts.TaskResult = ScriptResults.Failure
End Sub
Run Code Online (Sandbox Code Playgroud)

编辑3:如果将来有人对测试InteractiveMode的代码感兴趣.它也必须通过Script Task的ReadOnlyVariables传入.我最后修改了包,因为还有其他问题.

VB.NET
If CBool(Dts.Variables("System::InteractiveMode").Value) = True Then
    ....
End if

C#
if ((bool)Dts.Variables["System::InteractiveMode"].Value == true)
    ....
}
Run Code Online (Sandbox Code Playgroud)

mer*_*kel 0

如果将来有人对测试 InteractiveMode 的代码感兴趣。它还必须通过脚本任务的 ReadOnlyVariables 传入。由于还有其他问题,我最终修改了包。

VB.NET
If CBool(Dts.Variables("System::InteractiveMode").Value) = True Then
    ....
End if

C#
if ((bool)Dts.Variables["System::InteractiveMode"].Value == true)
    ....
}
Run Code Online (Sandbox Code Playgroud)