Question : Writing a VB.Net script component in SSIS

I'm trying to write a SSIS package. Actually, I am moving an old DTS created with SQL server 2000 in order to have a new one on SQL server 2008.
My problem is that the old DTS uses Active X components
Main =  DTSTransformStat_SkipRow and
Main = DTSTransformStat_OK.
I don't know if there is an equivalent for these components in SSIS . I am trying to use VB.Net code in the transform script component .

Answer : Writing a VB.Net script component in SSIS

OH!
I should shame for this simple question, so I made it hard !
you can use your first code, the only thing is that you should define your variables in the class. like this:


/* Microsoft SQL Server Integration Services Script Component
*  Write scripts using Microsoft Visual C# 2008.
*  ScriptMain is the entry point class of the script.*/

using System;
using System.Data;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;

[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
   int r= 0;
int s=0;

   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 Input0_ProcessInputRow(Input0Buffer Row)
   {
       r = r + 1;
     s = s + 1;
     Row.dparent = "Novelis";
     Row.dssn = Row.SSN;
     if (!Row.HOMEPHONE_IsNull)
         Row.dhome = Row.HOMEPHONE;
     Row.daddr1 = Row.ADDRESSLINE1;
     Row.daddrname = Row.ADDRESSLINE1;
     Row.daddr2 = Row.ADDRESSLINE2;
     Row.dcity = Row.ADDRESSCITY;
     Row.dstate = Row.ADDRESSSTATE;
     Row.dzip = Row.ADDRESSZIPCODE;
     Row.dpartyUID = Row.SSN;
     Row.difrowstat = Variables.ifrowstat;
     Row.difrowbatchnum = Variables.ifrowbatchnum;
     Row.difrowstatnum = s;
     Row.drowid = r;
     Row.dpartytypecd = Variables.partytypecd;
       
   }

}


forgive me to confusing you on this issue .



Random Solutions  
 
programming4us programming4us