dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

Script Error on Output0buffer - emailaddresstxt - why ? - ms-sqlserver

This is a discussion on Script Error on Output0buffer - emailaddresstxt - why ? - ms-sqlserver ; I have the following script and just want to pass same data thru the script. I cant get the SSIS 'copy column" function to work and the output0buffer.emailout works fine. Why does the output0buffer.emailaddresstxt not work ? Thanks using System; ...


Home > Database Forum > Microsoft SQL Server > ms-sqlserver > Script Error on Output0buffer - emailaddresstxt - why ?

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 05-19-2009, 11:16 AM
Database Newbie
 
Join Date: May 2009
Posts: 1
gsxrian99 is on a distinguished road
Default Script Error on Output0buffer - emailaddresstxt - why ?

I have the following script and just want to pass same data thru the script.
I cant get the SSIS 'copy column" function to work and the output0buffer.emailout works fine.
Why does the output0buffer.emailaddresstxt not work ?
Thanks



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

[Microsoft.SqlServer.Dts.Pipeline.SSISScriptCompone ntEntryPointAttribute]
public class ScriptMain : UserComponent
{

public override void PreExecute()
{
base.PreExecute();
}

public override void PostExecute()
{
base.PostExecute();
}


public override void Input0_ProcessInputRow(Input0Buffer Row)

{

string m = ValidateEmailRow(Row.EMAILADDRESSTXT.ToString());

if (m.Length > 0)

{

Output0Buffer.AddRow();

Output0Buffer.emailout = m;

Output0Buffer.EMAILADDRESSTXT = row.EMAILADDRESSTXT;
}

else

{

Output0Buffer.AddRow();

Output0Buffer.emailout = "No emails found";

}
}
public string ValidateEmailRow(string email)
{

string emails = "";

Regex reg = new Regex(@"\b([a-zA-Z0-9._%+-]+)@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,4})\b");

Match validate = reg.Match(email);

while (validate.Success)
{

emails += validate.Value.ToString() + ";";

validate = validate.NextMatch();

}

return emails;
}
}
Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 04:12 PM.