Hi guys,
I receive a raw import file, which I pump into a staging table, then I need to import into my prod table, one of the fields (column) in my staging table contains multiple values (comma seperated), my task is to parse these values into seperate columns of my prod table.
I found a helper function and wrote a stored proc that do that runs recursively for all the records... however........ it kindof works but it's way too slow for the amount of records im planning to import... hence I need your help...
The data contains vehicle options... the import value I receive should be limited to 35 comma seperated values,
which I then parse into columns o1 to o35 (value can also be empty).
Here's sample of the imported comma seperated column value:
Central Locking,Black 5 x 7 exterior mirrors,Tinted glass,Variable intermittent windshield wipers,300MPH:),120 MPH primary speedometer,Electronic AM/FM stereo radio w/cassette (4) speakers,Cigar lighter,Dual cloth covered sun visors w/RH mirror,600-amp maintenance-free battery,117-amp alternator,High strength 30000 PSI carbon steel frame,6.5'' pickup box-inc: double wall construction 2-tier loading,Independent front suspension,HD front/rear shock absorbers,Front stabilizer bar,Conventional spare tire & wheel w/winch-type carrier,Pwr rack & pinion steering,Rear anti-lock brakes,Dual note electric horn,Flat Screen Monitors,Funky Interior
Which should import into the following columns:
o1 o2 o3 o4 o5 ect.....
Central Locking Black 5 x 7 exterior mirrors Tinted glass Variable intermittent windshield wipers 300MPH:) ect....
The above is an example of one VIN (vehicle), I can import up to 10,000 records at a time and would like that to happen in like less than 10min if possible, at the moment it takes well over 3 hours.
If you need to see the code I have so far let me know, if you have your own function or sp that I can use that would be great,
Thanks!