Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS 1 Textfile with 2 types of records to 2 tables ... doable?

Status
Not open for further replies.

casorter

Programmer
Nov 19, 2003
15
US
Hi everyone,

I have an import function that i am currently doing programatically, parsing through a text file massaging the data and putting it into 2 tables .. lets call them summary and detail...
here is a look at a simplified view of the text file
<recordID>,<SummaryID>,<SummaryData>
<recordID>,<summaryID>,<DetailID>,<DetailData>
<recordID>,<summaryID>,<DetailID>,<DetailData>
<recordID>,<summaryID>,<DetailID>,<DetailData>
<recordID>,<summaryID>,<DetailID>,<DetailData>
<recordID>,<SummaryID>,<SummaryData>
<recordID>,<summaryID>,<DetailID>,<DetailData>
<recordID>,<summaryID>,<DetailID>,<DetailData>
<recordID>,<summaryID>,<DetailID>,<DetailData>
.
.
.
the <recordID> field at the begining of each line identifies it to the parsing program as a summary or detail record.

ok.. the problem is that reading through all these records (up to 5 meg) takes a long time. I know that DTS is faster but i don't think that i can do this like i want to with dts .. because dts maps the entire input file to a specific schema at the front end.. and my textfile contains different types of records... Is there a way to do this faster?

thanks for the help.
Mark
 
sorry... did not see the DTS section... will post there

 
What did with this type of data is use DTS to bring it into a one field holding table and use t-SQL to parse out the individual records to the correct place. Of course mine are all fixed length delimted which makes this somewhat easier to write the T-SQL.

Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top