Solved

Insert using OPENQUERY into a linked server is failing with OLE DB provider 'MSDASQL' reported an error. The provider did not give any information about the error

Posted on 2006-11-07
13
3,869 Views
Last Modified: 2012-05-05
Hi, I am trying to insert data via a linked server into a navision database...

I am using sql server 2000 and am using Navisions C/ODBC driver.

I can query the linked server and pull back data no problem...

But when I attempt the following it all goes wrong :

insert into OPENQUERY(NAVISION_DB,'SELECT Type,Code,Description FROM FDR_Fund_Type')
VALUES ('Fund','Test','SQLServer')

The following is displayed :
Server: Msg 7399, Level 16, State 1, Procedure NAV_DATE_TEST, Line 33
OLE DB provider 'MSDASQL' reported an error. The provider did not give any information about the error.
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize returned 0x80004005:  The provider did not give any information about the error.].


Any ideas, this is driving me insane!!!

Chris
0
Comment
Question by:bougeac
  • 5
  • 4
13 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17888222
what are the data types of the fields in the destination table?
also, what kind of database is the linked server NAVISION_DB poinint to?
0
 

Author Comment

by:bougeac
ID: 17888382
Hi, the linked server is pointing to a NAVISION C/Side database.

The target columns appear to be native NAVISION datatypes :

Type = "option"
Code = "code"
Description = "text"

Also another weird thing, after the insert attempt fails, my connection to the linked server from within sqlserver dies.

So when i click on the linked server to expand the tables i get an error message containing
MSDASQL IDBInitialize::Initialize returned 0x80004005

Help!

0
 
LVL 28

Expert Comment

by:imran_fast
ID: 17888887
Try this

insert into OPENQUERY(NAVISION_DB,'SELECT Type,Code,Description FROM FDR_Fund_Type where 1=0')
VALUES ('Fund','Test','SQLServer')
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 28

Expert Comment

by:imran_fast
ID: 17888893
Note In the INSERT statement, a where 1=0 predicate is used to avoid retrieving data from the remote server, which can result in slower performance
0
 

Author Comment

by:bougeac
ID: 17889250
Hi Imran, thanks for the reply.

Unfortunately, apart from the "where clause" my statement is identical to yours and fails accordingly.

cheers,

chris
0
 
LVL 28

Expert Comment

by:imran_fast
ID: 17889296
>>Unfortunately, apart from the "where clause" my statement is identical to yours and fails accordingly.

I know but did you try mine
0
 

Author Comment

by:bougeac
ID: 17889322
Hi Imran,

yes , i tried your statement and it generates the same error I was getting before.

cheers,

Chris
0
 
LVL 28

Expert Comment

by:imran_fast
ID: 17889374
is this statement working

select * from OPENQUERY(NAVISION_DB,'SELECT Type,Code,Description FROM FDR_Fund_Type')
0
 

Author Comment

by:bougeac
ID: 17889409
Hi Imran,
yep, that statement works fine.

This is whats frustrating, I can suck data OUT but not alter ,wondering if its some sort of permissions/security
0
 
LVL 28

Accepted Solution

by:
imran_fast earned 250 total points
ID: 17889487
May be security or there might be some triggers on that destination table.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question