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,875 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
13 Comments
 
LVL 143

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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

739 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