Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Error handling 在SSIS 2014目录中插入一条消息,用于在集成数据时报告错误_Error Handling_Ssis_Sql Server 2014_Catalog - Fatal编程技术网

Error handling 在SSIS 2014目录中插入一条消息,用于在集成数据时报告错误

Error handling 在SSIS 2014目录中插入一条消息,用于在集成数据时报告错误,error-handling,ssis,sql-server-2014,catalog,Error Handling,Ssis,Sql Server 2014,Catalog,我需要一些关于SQL Server 2014目录的帮助。 我正在开发一个SSIS包,它将以一个脚本任务开始,该任务将检查源文件是否存在。 如果需要的文件不存在,我需要返回一个成功的包结果,但还需要在日志中写一条消息,说明没有源文件或其他东西。。 这是我的测验 String FilePathEXOR = Dts.Variables["$FilePath"].Value.ToString() + "\\" + DateTime.Now.ToString("yyyyMMdd") + ".csv";

我需要一些关于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 

        }
谢谢你…

快到了

让脚本返回成功或失败,然后根据成功与否分别写入日志-但不在脚本任务范围内


有关写入日志的信息。

谢谢您的回答,但问题是我找不到任何可以在日志中写入的内容。我的问题是如何在那里写字。用SSIS组件之类的!!为您添加了一个链接感谢Jim的回复,但在我们的项目中,我们没有一个SQL表来记录或记录日志文件,我们正在管理SSIS目录中的所有包。然后我需要直接从SSIS包中写入,这就是整个问题所在……好吧,这是一个奇怪的要求。我想你可以允许包失败——这会显示在日志中。不过,我不建议这样做。