Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to move data into a SQL-Server database?
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00540114
Message ID:
00540210
Views:
14
>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.
>
Bulk Copy Program.


>>>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.

I don't see why not. Naturally, you'll have to use an ODBC driver or ADO to do it. It just would seem to be easier to use VFP to do it.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform