February 22, 2012 at 12:29 pm
Hi,
I am trying to create a source script component in SSIS to get data from a C# library.
One of the data that the c# library return is an object called value["forecastDateTime"] which contains a string like "2012-02-21T03:23:34.053254-08:00"
In the CreateNewOutputRows method of the script main I have
OutputBuffer.CreateDatetime = DateTimeOffset.ParseExact(value["forecastDateTime"].ToString(), "yyyy-MM-ddTHH:mm:ss.ffffffzzz", null);
It is assigning the value to the output buffer for the SSIS to get.
Where OutputBuffer.CreateDatetime is of type
database timestamp with timezone [DT_DBTIMESTAMPOFFSET]
When I run the SSIS it returns the following error:
Script Component has encourtered an exception in user code:
The value is too large to fit in the column data area of the buffer.
at Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer.SetDateTimeOffset(Int32 columnIndex, DateTimeOffset value)
at Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer.set_Item(Int32 columnIndex, Object value)
at Microsoft.SqlServer.Dts.Pipeline.ScriptBuffer.set_Item(Int32 ColumnIndex, Object value)
at OutputBuffer.set_CreateDatetime(DateTimeOffset value)
at ScriptMain.CreateNewOutputRows()
at UserComponent.PrimeOutput(Int32 Outputs, Int32[] OutputIDs, PipelineBuffer[] Buffers)
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PrimeOutput(Int32 outputs, Int32[] outputIDs, PipelineBuffer[] buffers)
Does anyone know how to pass off a datetimeoffset value into the SSIS through script component without having this problem? Help will be greatly appreciated.
February 22, 2012 at 1:20 pm
It seems that the script component cannot take in the millseconds along with everything. Once that is remove, the buffer error is gone. Well I guess missing the millseconds is no biggy, so it's resolved now.
June 22, 2016 at 5:25 pm
Add 7 to the scale of the datetime offset output column to fit the milliseconds
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply