January 23, 2013 at 5:46 pm
I'd have sworn we had an SSIS section round these parts. Anyway.
Version: 2k8R2 SSIS via VS2k8 interface to BIDS.
Alright, short version. I've got a fixed width text file that leaves blanks for numbers in certain circumstances. I'm converting this from a larger process and it's a midpoint step.
Fixed Width files cannot inbound a null value, as this field in particular is 16 characters, so it imports 16 blanks into the field. Can't make it numeric on inbound. So, I figure I'll Null them after import and then do a conversion. Simple enough.
Or not.
I get this lovely noise:
... other errors chaining off the error ...
The datatype is being cast so I can include a NULL into the field. I know I've done this before.
Anyone got an idea (or two)?
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
January 23, 2013 at 5:56 pm
I finally managed to get my google-fu going, but posting for resolution.
The answer is.... (Hey, Maestro... drumroll please? Dude? Dammit)...
TRIM( (DT_STR,16,1252)Quantity) =="" ? (DT_STR,16,1252)NULL(DT_STR,16,1252) : Quantity
You have to cast the null as the datatype that you're telling it as one of its parameters.
God I just love the Expression language.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply