Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have 2 examples of simple stored

Status
Not open for further replies.

cp84

Programmer
Apr 2, 2003
11
0
0
GB
I have 2 examples of simple stored procs the first works and the second gives the error "The OLE DB Provider 'MSDASQL' inicates that the object has no columns"

Ex.1
SELECT * FROM OPENQUERY(LinkedServer,'Select de_refno,de_name FROM Departmt ORDER BY de_refno')

Ex.2
SELECT * FROM OPENQUERY(LinkedServer,'UPDATE Departmt SET de_name='' WHERE de_refno=''yyy''')

The data files are FoxPro 2.6 DOS and the SystemDSN is using Microsoft VFP Driver

Very gratefully for any help with this problem
 
Hello,

I don't think your second example will not return any records because it is an update query.

Carla

Documentation: A Shaft of light into a Coded world
 
This is a Mircosoft SQL Server forum. If you are using Foxpro you are in the wrong place. Since the SQL sysntax is differnt from product to product an answer that we would give might not work in FoxPro. Suggest you post this in the FoxPro forum
 
This will give you problems....

SET de_name='' WHERE de_refno=''yyy'''

It's the same as:
SET de_name=''SET de_name=''xxx'' WHERE de_refno=''yyy'''

The second part will NEVER happen! There won't be any xxx in de_name since the first part SET all of de_name to www.

-SQLBill
 
The proper syntax for performing an update when using OpenQuery is...

UPDATE OPENQUERY(LinkedServer,
'Select * From Departmt WHERE de_refno=''yyy''')
SET de_name='



If you want to get the best answer for your question read faq183-874 and faq183-3179.
Terry L. Broadbent - DBA
SQL Server Page:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top