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,866 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
 
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now