0

When I set the TargetServerVersion = SqlServer2012 in my SSIS project, my script component throws a null object exception.

I am importing about 140,000 records from a CSV file. To confirm I do get records, I removed my script component step and ran the flow with no issues.

enter image description here

I then added back in the Script Component (which has worked fine with this very data file) and I get the null exception.

When I debug the script and check the value of the Row property it says the following:

?Row
{Input0Buffer}
    Buffer: {Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer}
    BufferColumnIndexes: {int[2]}
    MembershipPlanName: 'Row.MembershipPlanName' threw an exception of type 'System.NullReferenceException'
    MembershipPlanName_IsNull: 'Row.MembershipPlanName_IsNull' threw an exception of type 'System.NullReferenceException'

The script then fails when the rest of the lines try to reference Row. When I change the TargetServerVersion back to 2016 or 2014, the package works fine.

During debegging I also looked at BufferWrapper.cs and there seems to be some data in there

?Buffer
{Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer}
    ColumnCount: 2
    ColumnInfo: 0x0000000000000000
    CurrentRow: 0
    EndOfRowset: false
    Mode: Input
    RowCount: 9936
    RowSize: 260145280
    RowStarts: 0x000000000f82b700

1 Answer 1

1

Out of frustration I installed SSDT for VS2012. For some reason, that made everything work fine in VS2015. Not sure why it worked, but posting this if anyone has a similar issue.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.