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,872 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 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

Suggested Solutions

Title # Comments Views Activity
LTrim & Double Space Correction 5 42
AD and SQL Server 2016 2 29
Where is the Help Section? 8 29
Update one rows based on previous row 5 6
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.

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