Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Joining remote table with local cursor
Message
De
07/07/2004 14:11:24
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
07/07/2004 13:48:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00921514
Message ID:
00921530
Vues:
28
>What is the best way to join a remote table (SQL Server) with local (VFP) data. I'm thinking of creating an XML file (conting VFP data) using cursortoxml() & having a stored proc. in SQL join this with it's own table. Is this a possibility & is it the way to go? If someone could point me in the right direction I'd appreciate it. The problem is that I'd like to migrate some tables to SQL, but not all at once.

Linked servers, OpenRowSet() are first that come to my mind.
ie: with openrowset()
Select st.*, vt.myField from SQLserverTable as st
  inner join 
  OPENROWSET('VFPOLEDB', 'c:\myPath\myDB.dbc';'';'','select * from VFPTable') as vt
  on st.Id = vt.Id
Update : 2 view declarations using SQL and VFP tables (for an in (...) query) :
CREATE SQL VIEW "CUSINSPECIFICCOUNTRY" ; 
   REMOTE CONNECT "SQLNW" share ; 
   AS SELECT rmtR.* FROM Customers as rmtR ;
   inner join #myCountries as locR ;
   on rmtR.country = locR.countryName

CREATE SQL VIEW "CUSINSPECIFICCOUNTRY" ; 
   REMOTE CONNECT "SQLNW" share ; 
   AS SELECT rmtR.* FROM Customers as rmtR ;
   inner join OPENROWSET('VFPOLEDB.1', 'd:\cetin\ddrive\temp\InQuery.dbc';'';'','select * from myCountries') as locR ;
   on rmtR.country = locR.cntryName
First one creates temp table on SQL server while the second uses OpenRowSet.

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