Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to move data into a SQL-Server database?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00540114
Message ID:
00540205
Vues:
24
To all who replied, Thanks for the response.

>>Besides BCP that Vlad mentioned, you could use Data Transformation Services (DTS) that come with SQL Server to import data. In general BCP is more efficient, but DTS is easier to use...depending on your scenario.

What is BCP? I've worked with DTS.


>>You could also write your own VFP program that reads your flat file and sends SQL Statements (SQL-pass through) to insert your records.

This is closer to what I had in mind.

What I'm asking is:

For example; with xBase files, you can open a flat ascii file with C, open an xBase table (also in C, with appropriate libararies), parse out pieces of each line, insert a new record in the table using the parsed components of the line from the flat ascii file.

Pseudo code.
Open VFP data table

Open ascii source file

DO WHILE NOT FEOF()
   m.lcLine = FGet()
   IF NOT EMPTY(m.lcLine)
      Parse m.lcLine into components (i.e. array la_RawData)
      INSERT INTO <VFP table> FROM ARRAY la_RawData
   ENDIF
ENDDO
Is it possible to do something similar with SQL-Server:
1) Open a flat ascii file with C.
2) Open a SQL-Server database/table.
3) Parse out pieces of a line in the ascii file.
4) Insert a new record in the SQL-Server database/table... directly from the C program.

Regards,
Thom C.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform