I am using SSIS
and am trying to convert a flat file that has a column for SSN
and RN
to a table that has 2 columns, one for SSN
which is varchar(9)
and the other for RN
which is varchar(2)
.
How do I split the flat file up into the 2 separate columns?
Asked
Active
Viewed 32 times
0

Rakesh KR
- 6,357
- 5
- 40
- 55
-
what is the flat file look like in your case? is that delimited or just raw file? – LONG Feb 16 '17 at 16:01
-
It's a raw txt file – Brandon Massey Feb 16 '17 at 17:04
-
Can you add a part of the raw file and explain what you tried so far? – kloarubeek Feb 16 '17 at 22:51
1 Answers
0
I figured it out. I was trying to do a cast and i switched it to a substring. I created one expression that would start at the first character and pull 9 characters. I then created a second expression that would start at character 10 and pull 2 characters. Once that was done, I did a data conversion to switch them to a string.
SUBSTRING([SSN RN],1,9)
SUBSTRING([SSN RN],10,2)
The job was successful and was imported into the table as 2 separate columns