Trying to populate multple tables from a single source data file.
Posted on 2013-01-11
I am trying to populate a bunch of tables from data that is contained in a single text file. Not all target tables have the same number of columns. The text file has rows of data, with the first piece of data telling which file type (which target table) the subsequent data in the row is for.
See attached file for some sample data.
I tried just reading the source file into a single table, with the intent of parsing it and with t-sql and sending the rows of information to the appropriate target tables. But I couldn't get the import wizard to read the text file. It complained that the data was being truncated. I went in and adjust the field lenghts (it thought there were 3 fields) to the maximum, 255. But to no avail, it still would read it.
Thanks for your help!
Attached file has some data, and below are a few rows:
REC_TYPE_2|1|20120927 08:49:00|101|234223444|19750101|M|Brian|ODYSSEY|0513782||BEACH,BRIAN||||JOSEPH|ODYSSEY|025676||||||||||||SATURN MAIN theater|0513782|28497469||101
REC_TYPE_5|FOOD||3|||||JOSEPH|ODYSSEY|025676||0|||0|0.0||||1||||JOSEPH|ODYSSEY|025676|||||||||||||||||||||||||||||||||N|||| N/A|No upcoming days.|||||1||ADV||||||||0|102||111