Sie sind auf Seite 1von 6

I can understand the overview of the task what it is meant to do but I am dont

know the details of this. There is a error message now coming into the ETL
program which is pointing here or just before this script task. Overview of this
task is to get an error description as an output to this task from the update
statement task which runs before this script task.

This above screenshot tells the columns which are coming as input into the script
task(Script task is the component used to execute c# code).
Below are the scripts used.

Wrapper.cs
/* THIS IS AUTO-GENERATED CODE THAT WILL BE OVERWRITTEN! DO NOT EDIT!
* Microsoft SQL Server Integration Services buffer wrappers
* This module defines classes for accessing data flow buffers
* THIS IS AUTO-GENERATED CODE THAT WILL BE OVERWRITTEN! DO NOT EDIT! */

using
using
using
using

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

public class InputBuffer: ScriptBuffer


{
public InputBuffer(PipelineBuffer Buffer, int[] BufferColumnIndexes, OutputNameMap
OutputMap)
: base(Buffer, BufferColumnIndexes, OutputMap)
{

}
public String OLEDBSourceLineageString
{
get
{
return Buffer.GetString(BufferColumnIndexes[0]);
}
}
public bool OLEDBSourceLineageString_IsNull
{
get
{
return IsNull(0);
}
}
public DateTime LineageTMST
{
get
{
return Buffer.GetDateTime(BufferColumnIndexes[1]);
}
}
public bool LineageTMST_IsNull
{
get
{
return IsNull(1);
}
}
public String AddMetadataLineageString
{
get
{
return Buffer.GetString(BufferColumnIndexes[2]);
}
}
public bool AddMetadataLineageString_IsNull
{
get
{
return IsNull(2);
}
}
public Int32 UpdateErrorCode
{
get
{
return Buffer.GetInt32(BufferColumnIndexes[3]);
}
}
public bool UpdateErrorCode_IsNull
{
get
{
return IsNull(3);
}
}
public Int32 ErrorColumn

get
{
return Buffer.GetInt32(BufferColumnIndexes[4]);
}

}
public bool ErrorColumn_IsNull
{
get
{
return IsNull(4);
}
}

public Int32 StageKey


{
get
{
return Buffer.GetInt32(BufferColumnIndexes[5]);
}
}
public bool StageKey_IsNull
{
get
{
return IsNull(5);
}
}
public String ErrorDescription
{
set
{
this[6] = value;
}
}
public bool ErrorDescription_IsNull
{
set
{
if (value)
{
SetNull(6);
}
else
{
throw new InvalidOperationException("IsNull property cannot be set to False. Assign
a value to the column instead.");
}
}
}
new public bool NextRow()
{
return base.NextRow();
}
new public bool EndOfRowset()
{
return base.EndOfRowset();
}
}

Component.cs
/* THIS IS AUTO-GENERATED CODE THAT WILL BE OVERWRITTEN! DO NOT EDIT!
* Microsoft SQL Server Integration Services component wrapper
* This module defines the base class for your component
* THIS IS AUTO-GENERATED CODE THAT WILL BE OVERWRITTEN! DO NOT EDIT! */
using
using
using
using
using

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

public class UserComponent: ScriptComponent


{
public Connections Connections;
public Variables Variables;
public UserComponent()
{
Connections = new Connections(this);
Variables = new Variables(this);
}
public override void ProcessInput(int InputID, string InputName, PipelineBuffer Buffer,
OutputNameMap OutputMap)
{
if (InputName.Equals(@"Input", StringComparison.Ordinal))
{
Input_ProcessInput(new InputBuffer(Buffer, GetColumnIndexes(InputID), OutputMap));
}
}
public virtual void Input_ProcessInput(InputBuffer Buffer)
{
while (Buffer.NextRow())
{
Input_ProcessInputRow(Buffer);
}
}
public virtual void Input_ProcessInputRow(InputBuffer Row)
{
}
}
public class Connections
{
ScriptComponent ParentComponent;
public Connections(ScriptComponent Component)
{
ParentComponent = Component;
}
}
public class Variables

ScriptComponent ParentComponent;
public Variables(ScriptComponent Component)
{
ParentComponent = Component;
}

Main.cs
/* 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 Input_ProcessInputRow(InputBuffer Row)
{
Row.ErrorDescription = ComponentMetaData.GetErrorDescription(Row.ErrorColumn);
}
}

Not sure if this below screenshot helps but I took it from the script task.

Das könnte Ihnen auch gefallen