3

I'm Working on synchronizing two databases in order to migrate from a legacy FoxPro database to Sql Server.

i have a foxpro code that loads and transforms data, and wondering how to call that procedure from SQL server? even in MSDN i have only found examples that do the opposite, call sql from fox...

i'm looking for a pure SQL solution, no third party component or application .

joe
  • 546
  • 1
  • 6
  • 20
  • I believe you will have to call foxpro procedure from command prompt , something like !foxpro @proc_name , and this needs to be called with system command – Satya Jul 03 '13 at 13:35
  • You could create a SQL Agent job to run the foxpro application and then invoke that job from T-SQL. – nvogel Jul 03 '13 at 13:44
  • @sqlvogel: it's not really an application, it's referenced inside the DBC file (Stored procedure), i do not want to add another layer (another application) to this system, and that's why i was wondering if there's something similar to this : http://support.microsoft.com/kb/114787 but in the opposite direction: T-SQL to FOX – joe Jul 03 '13 at 13:52
  • @Satya: which command prompt? what system command? do you have an example? thanks – joe Jul 03 '13 at 13:54
  • 1
    @Satya. In order to run a FoxPro program you either need to compile it into an executable (EXE application) or you need to run it from inside FoxPro itself. SQL Server can't run FoxPro source code - only executables. – nvogel Jul 03 '13 at 14:03
  • @sqlvogel that's what i thought, thanks for confirming. – joe Jul 03 '13 at 14:29
  • seems like nobody can give a tip about old Fox! anyone can think of a different scenario? – joe Jul 08 '13 at 13:52

1 Answers1

1

It looks like you can attach certain versions of Visual FoxPro using SQL Server's Linked Server feature. Here is a knowledge base article. After you attach it you should be able to get to the FoxPro SP by using an openquery. If you can't do it that way you will have to use the CLI to pull the data.

Marissa
  • 430
  • 3
  • 12
  • it looks like what's I'm trying to do from SQL Server, i will give it a try, thank you for your help. – joe Jul 10 '13 at 19:05