[英]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.