Discussion:
Text Data source is "unfixed" number of columns and names
(too old to reply)
always a Newbie
2010-05-11 17:32:12 UTC
Permalink
Hi,
I am designing a package to load data from a text file that the
number of columns are not "fixed".
The number of columns and names are changing from one file to another,
meaning, a column is avaible in one file but not in another.
What is your suggestion?
Thanks
Todd C
2010-05-12 13:05:01 UTC
Permalink
Sounds like a job for a Script component on your Data Flow to act as the
Source adapter.
In it you will need to specify all possible output fields that could ever be
generated by the script.
Then inside the script, read the file one row at a time and put all your
logic in there about what fields should be sent out to the data flow.

HTH
--
Todd C
MCTS SQL Server 2005
Post by always a Newbie
Hi,
I am designing a package to load data from a text file that the
number of columns are not "fixed".
The number of columns and names are changing from one file to another,
meaning, a column is avaible in one file but not in another.
What is your suggestion?
Thanks
.
always a Newbie
2010-05-24 22:22:41 UTC
Permalink
My solution:
Bring the entire file in as one fixed length and use SQL to parse each
column.
Post by Todd C
Sounds like a job for a Script component on your Data Flow to act as the
Source adapter.
In it you will need to specify all possible output fields that could ever be
generated by the script.
Then inside the script, read the file one row at a time and put all your
logic in there about what fields should be sent out to the data flow.
HTH
--
Todd C
MCTS SQL Server 2005
Post by always a Newbie
Hi,
I am designing a package to load data from a text file that the
number of columns are not "fixed".
The number of columns and names are changing from one file to another,
meaning, a column is avaible in one file but not in another.
What is your suggestion?
Thanks
.- Hide quoted text -
- Show quoted text -
Loading...