提问人:Conrad Jagger 提问时间:10/25/2012 最后编辑:John SaundersConrad Jagger 更新时间:10/26/2012 访问量:14448
SSIS - 如何在脚本任务中访问系统变量
SSIS - how to access system variables in Script Task
答:
11赞
milivojeviCH
10/25/2012
#1
在脚本任务编辑器中,在 ReadOnlyVariables 字段中提供要访问的变量名称(例如 System::P ackageName)。
在脚本的 C# 示例中,使用以下命令:
public void Main()
{
bool fireAgain = true;
// Read the variable
String PackageName = (String)Dts.Variables["System::PackageName"].Value;
// Post the value to progress results
Dts.Events.FireInformation(3, "Package name:", PackageName, "", 0, ref fireAgain);
Dts.TaskResult = (int)ScriptResults.Success;
}
结果:
评论