【问题标题】:Insert a message in the SSIS 2014 Catalog for reporting an error while integrating data在 SSIS 2014 目录中插入一条消息,用于在集成数据时报告错误
【发布时间】:2016-04-26 09:10:55
【问题描述】:

我需要一些有关 SQL Server 2014 目录的帮助。 我正在开发一个 SSIS 包,该包将从一个脚本任务开始,该任务将检查源文件是否存在。 如果需要的文件不存在,我需要将成功作为打包结果返回,但还需要在日志中写一条消息,说明没有源文件或其他东西.. 这是我的测试

 String FilePathEXOR = Dts.Variables["$FilePath"].Value.ToString() + "\\" + DateTime.Now.ToString("yyyyMMdd") + ".csv";

        if (!File.Exists(FilePathEXOR))
        {
            Dts.Variables["User::VAR_BOOL_File_Verif_EXOM"].Value = false;//Variable that will tell if we continue or not the package execution
            Dts.TaskResult = (int)ScriptResults.Success;
           //Writing Some message in the catalogue saying that we've passed the package to success but there was no integration because we didn't find the Source files 

        }

谢谢...

【问题讨论】:

    标签: error-handling ssis sql-server-2014 catalog


    【解决方案1】:

    差不多了!

    让您的脚本返回成功或失败,然后根据成功分别写入日志 - 但在脚本任务之外。

    关于写入日志here的信息。

    【讨论】:

    • 感谢您的回答,但问题是我找不到任何可以让我在日志中写入的内容。我的问题是如何在那里写。带有 SSIS 组件或其他东西!
    • 为你添加了链接
    • 感谢 Jim 的回复,但在我们的项目中,我们没有用于记录的 SQL 表,也没有日志文件,我们正在管理 SSIS 目录中的所有包。那么我需要直接从 SSIS 包中写入,这就是整个问题......
    • 好的,这是一个奇怪的要求。我想你可以让包失败——这会出现在日志中。不过我不推荐这个。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-10-26
    • 2015-05-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多