Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update SQL table from VFP table
Message
From
31/08/2015 10:33:27
 
 
To
31/08/2015 09:22:51
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01623948
Message ID:
01624017
Views:
63
>
>This is what I get for working on a Friday...
>
>The Fox table is ~700 rows at the moment, a monthly update from outside, so no telling how large or small it might get; the SQL table is several million. I've written a VFP program to handle the file, look up ID#s, post a couple changes. Last in the process, it needs to update the SQL file so another internal app can act upon the changes, and I'd prefer to do it from the VFP program.
>
>I'm not strong with SQL server, but I can open the SQL database, and I have the update statement but it seems to imply both tables in the same format. I don't know how to get the VFP table into SQL temporarily, or write to the SQL table without downloading the whole thing...

There are several ways to push data from VFP to SQL Server. You can use ODBC, you can define linked servers, you can use SQL Server Integration Services, etc.

Once the data is in a temp table in SQL Server, you can write an UPDATE statement to join your 2 SQL tables together.

I think the first goal is to get the data into SQL Server. if you do a web search on "upload vfp data into sql server", you'll find many online articles that talk about it.

My personal opinion, you should look at SQL Server Integration Services. Not only would it help you here, it might also help you down the road. SSIS is a great tool for getting data from one area to another. You can even use the SQL Server Import/Export wizard to define the "source area" (your fox table) and your "destination area" (the target temporary sql server table), and you can save the steps as an SSIS package.

So while there are many routes you can take, I'd suggest looking at SSIS. There are many websites and blogs that have talked about this. Here's one of them:

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/c32c0820-0e2d-4461-820a-530541c769c6/creating-a-ssis-package-to-get-data-from-free-dbf-visual-foxpro-table-in-64-bit-sql-server?forum=sqlintegrationservices
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform