简体   繁体   English

错误执行包含通过SQL Server代理作业的脚本任务的SSIS包时

[英]Error While executing a SSIS package which contains a script task through SQL Server Agent job

I have a SQL Server 2012 SSIS package with a script task along with other tasks [data flow, execute sql tasks ]. 我有一个SQL Server 2012 SSIS包,其中包含脚本任务以及其他任务[数据流,执行sql任务]。 When I manually executed the job its completed successfully. 当我手动执行作业时,它已成功完成。

But when I executed the package through SQL Job Agent , it is getting failed with the below error message. 但是,当我通过SQL Job Agent执行该程序包时,它失败并显示以下错误消息。

"Error: 2014-05-13 12:45:14.67 “错误:2014-05-13 12:45:14.67

Code: 0x00000001 代码:0x00000001

Source: Script Task 来源:脚本任务

Description: Exception has been thrown by the target of an invocation. 说明:调用的目标已引发异常。

End Error 结束错误

DTExec: The package execution returned DTSER_FAILURE (1). DTExec:程序包执行返回DTSER_FAILURE(1)。

Started: 12:45:10 PM 开始于:12:45:10 PM

Finished: 12:45:14 PM 已完成:下午12:45:14

Elapsed: 4.353 seconds" 耗时:4.353秒”

My Script Task is for load data in Text File and add to variable 我的Script Task用于在文本文件中加载数据并添加到变量

public void Main()
    {
        // TODO: Add your code here
        StreamReader sr = new StreamReader("E:\\IEREVISIPDKE\\IELOADING.txt");

        string st = sr.ReadToEnd();
        this.Dts.Variables["IE"].Value = st;

        //MessageBox.Show(st);

        Dts.TaskResult = (int)ScriptResults.Success;

Thanks, 谢谢,

try adding C:\\Windows\\System32\\config\\systemprofile\\Desktop folder. 尝试添加C:\\ Windows \\ System32 \\ config \\ systemprofile \\ Desktop文件夹。 It resolved my issue. 它解决了我的问题。

I think you need to add permission to your SQL Job Agent Service account to the specified folder. 我认为您需要将SQL Job Agent Service帐户的权限添加到指定的文件夹。

My best guess is that when you execute from SSIS, you run as yourself, and you have full access to your folder. 我最好的猜测是,当您从SSIS执行时,您可以自己运行,并且拥有对文件夹的完全访问权限。

When running SQL Job Agent , it uses the service to access your folder, and this user has no access to your specified folder. 运行SQL Job Agent ,它将使用该服务访问您的文件夹,而该用户无权访问您指定的文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过SQL Server代理作业执行SSIS包时出错 - Error when executing SSIS package through SQL Server Agent job 在SQL Server代理中执行SSIS包时出错 - Error executing SSIS package in SQL Server agent SSIS包-通过SQL Job Agent触发时,脚本任务无法执行 - SSIS package - Script task does not get executed when triggered through SQL Job Agent 从SQL Server代理作业调用的SSIS包的C#脚本组件上的错误 - Error on C# script component of an SSIS package callled from an SQL Server agent Job 从SQL Server代理作业运行SSIS包时出现死锁错误 - Deadlock error while running SSIS package from SQL Server Agent Job 从 SQL 服务器代理作业执行时 SSIS 脚本任务错误。 System.IO.FileNotFoundException:无法加载文件或程序集 - SSIS script task errors out when executing from SQL Server Agent Job . System.IO.FileNotFoundException: Could not load file or assembly 通过SQL Server代理运行SSIS包 - Running SSIS package through SQL server agent 在 SQL SERVER 上使用 ODBC 连接执行 SSIS 包时出错 - Error while executing an SSIS package with ODBC connection on SQL SERVER SSIS发送邮件任务未通过SQL Server代理作业运行 - SSIS send mail task doesn't run through SQL Server agent job 如何在我的 SQL 服务器代理作业中创建一个步骤,它将运行我的 SSIS package? - How do I create a step in my SQL Server Agent Job which will run my SSIS package?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM