We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

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

bougeac
bougeac asked
on
Medium Priority
4,041 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
Comment
Watch Question

Guy Hengel [angelIII / a3]Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009

Commented:
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?

Author

Commented:
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!

Top Expert 2006

Commented:
Try this

insert into OPENQUERY(NAVISION_DB,'SELECT Type,Code,Description FROM FDR_Fund_Type where 1=0')
VALUES ('Fund','Test','SQLServer')
Top Expert 2006

Commented:
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

Author

Commented:
Hi Imran, thanks for the reply.

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

cheers,

chris
Top Expert 2006

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

I know but did you try mine

Author

Commented:
Hi Imran,

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

cheers,

Chris
Top Expert 2006

Commented:
is this statement working

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

Author

Commented:
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
Top Expert 2006
Commented:
May be security or there might be some triggers on that destination table.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.