July 26, 2007 at 1:21 am
Hi, I am a beginner to ssis... There is a complex flat file of the format given below. I want to put it into sql srver 2005 database. I have tried most of the option in ssis. But was unable to migrate it to sql srver 2005 database. Please guide me in this regard. Is there a way?
Thank you
rec # 1
empname = anup , empid = 1001,
sal = 100000
age = 23
dept 101
rec # 2
empname = ananth , empid = 1002,
sal = 100000
age = 23
dept 101
July 26, 2007 at 1:58 am
Should be to difficult.
What delimits rec 1 from rec 2? Just a normal carriage return?
I would say use a flat file source, no column delimiter.
Then using a script component, you can hack apart the rows into new columns.
You can split them by = or white space which will handle your dept row.
For each 4 rows coming into the script component, you can output one new row which will have your 4 columns.
You could use a derived column and cut them up then pivot but that _might_ not work very well.
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
July 26, 2007 at 1:59 am
Come to think of it, rather use a script component as a source and read the file as a structured file, which it is, and build your output rows using that. Far simpler.
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply