Update SQL table from FoxPro OpenQuery SubSelect
Posted on 2009-04-06
I have a project where I have SQL server tables and Visual Fox Pro tables. I need to update an inventory qty in the SQL table, based on the qty located in a Visual Fox Pro table. I created a linked server, but need help with syntax. I am stuck on matching the SKU in the SQL table to the where condition in the openquery subselect. Here is what I have, that is not working:
SET qty = (select * from openquery(VFPRO, 'Select saq_qty from scsaqty where saq_sku = [MMan].[dbo].[items].itemno'))
I get the following error:
Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "Select saq_qty from scsaqty where saq_sku = [MMan].[dbo].[items].itemno" for execution against OLE DB provider "VFPOLEDB" for linked server "VFPRO".
Your help would be greatly appreciated.