June 3, 2009 at 9:38 am
Hi Guys,
I'm a newbie to SSIS, but seem to have been landed with the majority of DB tasks, so looks like I'll be making this place my new home :-).
The problem I'm having must be something you guys/guyettes do every day...
To simplify my problem... I've a CSV file I want to import with the following:-
[font="Courier New"]Joe Bloggs;Z0674 alksdjflkasjdflajsdflkasdj
John Smith;Z4836 laksdfkasjdflkasjdflkasjdflkajsdflajsf
Jarvis Cokcer;Z6726 jkjhkjgfjhgfgf[/font]
Where the first value is name, and the second a 5-character code associated with the person (their clock-card number to be specific). However, the 2nd column has random junk at the end.
My destination table is pretty simple:
[font="Courier New"]FullName - nvarchar[50]
ClockNum - nvarchar[5][/font]
So... I run through the "SSIS Import and Export Wizard"...
But I can't figure out how to tell it to do a [font="Courier New"]LEFT(col, 5)[/font] type of command so only the first 5 characters get imported. I keep getting variations on:-
[Data Conversion 1 [53]] Error: Data conversion failed while converting column "colClock" (22) to column "colClock" (73). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
I've gone through a few tutorials now, but they're all slightly different.
Can anybody help?
June 4, 2009 at 12:57 am
I suggest that you import your data as two columns: Name, TheRest and add a derived column transformation, ClockNum, which is defined as Left(TheRest, 5).
Phil
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
June 4, 2009 at 3:56 am
Hi, thanks for the tip, it helped get things working :).
June 8, 2009 at 6:07 am
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply