Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Network:
Windows 2003 Server
>VFP's Remote View provides an easily reproducible and accessible mechanism to do this. Even with no experience a developer can create an updateable RV against a SQL Server table in as little as a minute. After that you can simply USE the Remote View NODATA (use the NODATA because unless you specify a filter in the RV, it will pull across the whole SQL table!)
Even here I'd point to Cursoradapter as well, as the option to modify the generated SQL through a hook might help a lot: if upsert/merge capability is beneficial in the update task (not clear from OP) or adding other options as described below.
@Chris: If you expect more than a 1-shot task in vfp, invest 1H in reading up on Cursoradapter and implementing with it, it is only slightly more work than Remote View and teaches you a better tool. If you expect more work with MS SQL server than vfp, Kevin's suggestion might be better for you. If you expect working with vfp and different data backends (even MS SQL and vfp tables) go for Cursoradapter.
>Do the fields in SQL Server match or approximately match the dbf fields?
>If so, create an updateable VFP Remote View and simply append the dbf whenever you need to.
>If the match is not perfect, either get the dbf into a cursor/dbf that does match the SQL table and then append, or insert a set of expressions into the RV cursor.
>Watch out for datetime fields where VFP allows blank values but SQL Server does not. It's easiest to transfer a NULL if that happens.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement