You are on page 1of 1

/* Microsoft SQL Server Integration Services Script Component * Write scripts using Microsoft Visual C# 2008.

* ScriptMain is the entry point class of the script.*/ using using using using System; System.Data; Microsoft.SqlServer.Dts.Pipeline.Wrapper; Microsoft.SqlServer.Dts.Runtime.Wrapper;

[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute] public class ScriptMain : UserComponent { public override void PreExecute() { base.PreExecute(); /* Add your code here for preprocessing or remove if not needed */ } public override void PostExecute() { base.PostExecute(); /* Add your code here for postprocessing or remove if not needed You can set read/write variables here, for example: Variables.MyIntVar = 100 */ } public override void Entrada0_ProcessInput(Entrada0Buffer buffer) { while (buffer.NextRow()) { Entrada0_ProcessInputRow(buffer); } if (buffer.EndOfRowset()) { Salida0Buffer.SetEndOfRowset(); } } public override void Entrada0_ProcessInputRow(Entrada0Buffer Row) { var arr = Row.nombre.Split(','); foreach (string str in arr) { Salida0Buffer.AddRow(); if(!string.IsNullOrEmpty(Row.nombre)) { Salida0Buffer.idsalida = Row.id; Salida0Buffer.nombresalida=str; } } } }

You might also like