Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Extracting relational data from flat file CSV
Message
 
 
À
29/09/2010 19:54:34
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Database:
MS SQL Server
Divers
Thread ID:
01483281
Message ID:
01483321
Vues:
28
>>>Looking for ideas about doing a one-time data extraction from a CSV (which was generated from Adobe PDFs)
>>>
>>>The data represents an insurance policy. 30% of the columns - which have column headers that correspond to field names - represent columns that will be imported into the policy table. The remainder of the columns are a flat representation of child tables.
>>>
>>>prop1, prop2, prop3, prop4 should be extracted to four rows of the prop table ( as well as the key representing the policy, of course )
>>>
>>>ai1, ai2, ai3 etc ditto.
>>>
>>>One-time conversion to sql server database. Any suggestions on the best way to iterate the 500 or so rows of the CSV to create 500 policy records and their associated child data.
>>>
>>>TIA
>>
>>Sounds like a job for SSIS. Take a look at
>>6 ways to import a file to SQL Server
>
>Ah, a very good start. For some reason, though I'd been working with SSIS I forgot it would simplify dealing with CSV.
>
>So I think my step one will be to convert the CSV to a SQL table, at that point generating the integer keys for each row.
>
>I think that from there I can script iterating each set of columns that represent the child tables and inserting into pre-created child tables.
>
>Thanks for getting my head pointed in the right direction ( hmm, I now have a properly pointed head <s> )

Just in case I tried to get a different idea http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/b406d6ae-94f3-49de-a8a0-cd688072dcc2
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform