Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling Stored Procedure
Message
De
23/12/2008 08:05:22
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01369317
Message ID:
01369325
Vues:
19
>Can i call a stored procedure from Sql Server. The procedure is stored in a foxpro database. I need to call this procedure to prepare data sql server has to modify.
>
>Thanks.

Michele,
It is not clear what you want to do.

Yes you can call a VFP stored procedure from within SQL server. Check linked server, openquery(), openrowset(). ie:

* Add the linked server - must be done once
EXEC sp_addlinkedserver
    @server = N'VFP_SERVER',  -- Your linked server name here
    @srvproduct=N'Visual FoxPro 9',  -- can be anything
    @provider=N'VFPOLEDB',
    @datasrc=N'"C:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 9\Samples\data\testdata.dbc"'
After your linked server is setup you can make calls to SPs etc. ie:
insert mySQLTable (orderId, orderDate,shippedTo)
Select * From openquery(VFP_SERVER,
'Select
  order_ID,
 Cast(Evl(order_date,Null) As DateTime) As order_Date,
 TRIM(to_Name)
 from customer')
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