Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Import huge delimited text files into MSSQL with C#
Message
De
23/03/2007 11:17:22
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
23/03/2007 10:13:56
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01207643
Message ID:
01207710
Vues:
27
>I'm still exploring the .Net framework and I'm trying to do the following:
>
>Every day we receive between 500 MB to 1.5 gig of data from multiple tables in and oracle database that is being dumped into one huge text file. I have no control of how we receive this by the way, we have to accept what we are given by the client. The data is being delimited with a pipe "|". and the text file contains header records that contain the name of the table that the data following that header should be imported into.
>
>I have been successful in using fopen/fseek/fgets/occurs() in VFP to import the data into foxpro tables and then later upload those tables into SQL server, but I'd like to rewrite so that the data bypass the VFP tables entirely and goes directly into SQL, and the powers that be only want me to use C#/Visual studio 2005 as they want everything ported to that language eventually, especially any new programming.
>
>I've used the Visual FoxPro Toolkit for .NET by Kamal Patel that I learned a lot from. But I notice that there is no "FGETS" in that toolkit which reads a string of data until it encounters a Carriage return.
>
>My question is to find out what classes in the .NET framework would help me do this most effectively. I'm confident that the .NET framework has such a mechanism but I'd like to get some tips and/or get pointed in the right direction of which classes I should investigate for this task.
>
>I've used the Streamreader Class but I'm there is a better/more efficient way of doing this whole thing.
>
>Thanks in advance for your help and suggestions.
>
>-Rick

Yes it has. Check SqlBulkCopy class.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform