Showing posts with label basically. Show all posts
Showing posts with label basically. Show all posts

Saturday, February 25, 2012

Records not updating in Script Component

I am seeing a strange behavior in a script component that I can't figure out.

Basically, there is a field in my script that checks to see if a string field is length of 1. If it is, it updates the field with some value. The strange behavior is that it picks up some of the rows but not others.

If Row.FieldValue.Length = 1 Then

Row.FieldValue= "Some Value"

End If

I've tried variations such as:
If left(Row.FieldValue.,1) = "-" Then


Row.FieldValue= "Some Value"


End If

But I get the same results. Any Ideas?Does [Field] need to be trimmed? Might some data contain trailing white spaces?|||

No, I've tried every combination of Trim, left, equals etc...that I can think of. The funny thing is that it picks up some of the fields and misses others.

Very puzzling. I was hoping to hear of some rare condition on this board that sounds similar to this, but I have yet to hear of any similar situations.

The code that I am talking about is incredibly simple, as shown in my previous post.

|||What happens when [Field] is null?|||

You could fire some debug iformation to help you. Something like this maybe:

Me.ComponentMetadata.FireInformation(,,Row.FieldValue.ToString() + " - " + Row.FieldValue.Length.ToString(), ....

-Jamie

|||

Thanks, that did it. I am relatively new to SSIS, never really delved into the debug information before.

that is very helpful.

|||

KML67 wrote:

Thanks, that did it. I am relatively new to SSIS, never really delved into the debug information before.

that is very helpful.

Great! But what solved your issue?|||

Basically, matching the string by length, equal, explicit match was working fine all along.

There was some logic that followed this string test that was providing the error. The error was very subtle, so it did not always produce the same value for the same input (depending on multiple variables), but at quick glance (watching the data flow into and out of the component with dataviewers) it looked as like there was an inconsistency in the component itself.

Jamie's post was very helpful, I am new to SSIS and wasn't familiar with the fireInformation method. That allowed me to solve it in a second.

Thanks for the tips, this board is a great asset.

Records not commiting - please help!

So, I have this SSIS package that basically moves records from one table into another table in the same DB. I’m running it on the actual server and everything seems to work. The data-flow task lights up yellow and visual studio increments the number of records passed through as if they were running perfectly. However, when I go to look at the data,it’s not in there! There are no errors reported ad the event log doesn’t show anything that would lead me to think anything went wrong. Anyone ever run into this issue? I’m wracking my brain on this one and am completely stumped. Any help would really be appreciated

Do you wait until the process completes (goes green) to look for the records?|||

I've let it go all the way to the end and tried to look at the data while the move was hapening. I've played with all the OLE DB destination options as well with no luck. I've had batch sizes of anywhere from 1 to 1000 with no luck. SQL server activity monitor lists the bulk insert but it never leaves the "runnable" state.

I am using the OLE DB data source and destination and have one data conversion transform task between them.

|||Are you sure the records are valid? Double click on the OLE DB Destination and select "Error output" and ensure that it is set to "Fail component" instead of "Ignore failure."|||

Try using a destination table which has no rows. Then run your package, and see if the destination table has any rows now. That will help you identify if rows are not being inserted at all, or were inserted but some other failure happened.

|||

so, the destination table's totally empty. I ran the package all the way through and it's still not working!!! I can tell somethings happening since my drive's filling up as the thing trudges along. Very, very irritating~

|||

JimiTooCool wrote:

so, the destination table's totally empty. I ran the package all the way through and it's still not working!!! I can tell somethings happening since my drive's filling up as the thing trudges along. Very, very irritating~

Did you make sure that the error handling of the OLE DB destination was set to "Fail component"?