Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

SSIS on SQL Server 2008R2 "The value is too large to fit in the column data area of the buffer." Expand / Collapse
Author
Message
Posted Tuesday, July 29, 2014 7:24 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Sunday, October 12, 2014 4:00 PM
Points: 341, Visits: 751
Koen Verbeeck (7/29/2014)
Is it possible to post the .NET code?


Sure! Though note that the DataFLow task fails just before this code begins to execute:

/* 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
{

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)
{
const int MinExpectedNumberOfFields = 2;
const int MaxExpectedNumberOfFields = 3;
string[] values = Row.Data.Split(new char[] { '\t' }, MaxExpectedNumberOfFields);
// Check that correct number of values received
if (values.Length < MinExpectedNumberOfFields || values.Length > MaxExpectedNumberOfFields)
{
bool pbCancel = false;
this.ComponentMetaData.FireError(100,
"Process Detail Row",
String.Format("Incorrect number of fields. Expected: {0} to {1}, received: {2}",
MinExpectedNumberOfFields,
MaxExpectedNumberOfFields,
values.Length),
"No Help Available", 0, out pbCancel);
return;
}

Row.ErrorCode = values[0];
Row.ErrorMessage = values[1];
Row.LoggingActivityRecord = values.Length >= 3 ? values[2] : null;
}

}


Post #1597281
Posted Tuesday, July 29, 2014 7:38 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 7:39 AM
Points: 13,522, Visits: 11,312
Instead of the console line, try a message box perhaps?
Does everything work if you get rid of the script component?




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1597289
Posted Tuesday, July 29, 2014 8:11 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Sunday, October 12, 2014 4:00 PM
Points: 341, Visits: 751
Koen Verbeeck (7/29/2014)
Instead of the console line, try a message box perhaps?
Does everything work if you get rid of the script component?


I added calls to MessageBox before each statement in the script source. This finally exposed the problem:

I had been focused on the Data column, since that is what was increased. However, the sample data included the ErrorMessage column as well (See the source from the previous post). This column (not the data column) has now exceeded the specifications.

Koen, zonder uw hulp had ik deze fout helemaal gemissed!

Hartelijk bedankt!!
Post #1597311
Posted Tuesday, July 29, 2014 11:33 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 7:39 AM
Points: 13,522, Visits: 11,312
gbritton1 (7/29/2014)
Koen Verbeeck (7/29/2014)
Instead of the console line, try a message box perhaps?
Does everything work if you get rid of the script component?


I added calls to MessageBox before each statement in the script source. This finally exposed the problem:

I had been focused on the Data column, since that is what was increased. However, the sample data included the ErrorMessage column as well (See the source from the previous post). This column (not the data column) has now exceeded the specifications.

Koen, zonder uw hulp had ik deze fout helemaal gemissed!

Hartelijk bedankt!!


Glad you found the issue




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1597432
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse