开发者

Programmatically create script component of Data Flow task

How to progr开发者_C百科ammatically create script component of dataflow task in MS SQL Server 2008.


Below given link contains the Microsoft hands-on lab to create a custom transformation component in SSIS. The document pertains to SSIS 2005 but the logic should be applicable to SSIS 2008 as well.

SQL Server Integration Services (SSIS) Hands on Training - Creating Custom Components

Hope that helps.


This is the Code for creating a ScriptTask Programmatically.

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 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜