如何以编程方式在MS SQL Server 2008中创建数据流任务的脚本组件。
答案 0 :(得分:2)
下面给出的链接包含Microsoft动手实验,用于在SSIS中创建自定义转换组件。该文件适用于SSIS 2005,但该逻辑也适用于SSIS 2008。
SQL Server Integration Services (SSIS) Hands on Training - Creating Custom Components
希望有所帮助。
答案 1 :(得分:1)
这是以编程方式创建ScriptTask的代码。
Package pkg = new Package();
pkg.Executables.Add("STOCK:ScriptTask");
TaskHost th = (TaskHost)exec;
ScriptTask task = (ScriptTask)th.InnerObject;
task.ScriptProjectName = "YourProjectName.csproj”; // (or vbproj)
th.Name = name;
task.ScriptLanguage = CS_SCRIPT;
task.ReadWriteVariables = “User::Var1,User::Var2”; //Comma separated list of variables
task.ReadOnlyVariables = rvars;
task.ScriptingEngine.LoadScriptSolution(path); // This method loads solution and builds
task.ScriptingEngine.CloseIDE(true); // closes IDE and saves binary code