Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Joining remote table with local cursor
Message
From
07/07/2004 14:11:24
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
07/07/2004 13:48:03
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00921514
Message ID:
00921530
Views:
27
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform