2

I'm connected in sql server 2012, so I connect to sql server 2005 so after that I can connect to a firebird base.

my query is like this for 2 linked server:

INSERT OPENQUERY(2005server, 'SELECT TEST_ID, AGE FROM OPENQUERY(firebirdServer, ''SELECT TEST_ID, AGE FROM firebirdBase'')' ) VALUES (1, 22)

A exemple with 2 linked server that WORKS for me is:

INSERT OPENQUERY(firebirdServer, 'SELECT TEST_ID, AGE FROM firebirdBase') VALUES (1, 22);

ERROR with 2 linked servers (first code up):

OLE DB provider "SQLNCLI11" for linked server "2005server" returned message "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.". Msg 16955, Level 16, State 2, Line 1 Could not create an acceptable cursor.

anyone have already this error?

thanks!

Deiwys
  • 243
  • 1
  • 5
  • 15
  • What is this supposed to be doing? I don't understand why you need to use 2 linked servers. But I'm fairly certain that you can't do an OPENQUERY inside another OPENQUERY. – Tab Alleman Oct 15 '14 at 18:22
  • Because my database is 2012 and I need make it from 2012 to firebird.. and direct it dosent work.. and yes, openquery inside openquery works.. I can make select.. only insert I dont know how.. here an example of select that works with 2 openquery: SELECT * FROM OPENQUERY(2005server,' SELECT * FROM OPENQUERY( firebirdServer, ''select * from firebirdBase'' )') – Deiwys Oct 15 '14 at 19:51
  • Why can't you do it directly from SQL Server 2012? – Mark Rotteveel Oct 16 '14 at 09:07
  • Because the 32bits system, from sql server 2012 64bit the dll dont work, I dont know why to acess the firebird base, so need to connect to sqlserver 2005 before firebird base. Maybe there is a way to connect direct, but here doesnt work :) – Deiwys Oct 16 '14 at 18:31
  • You just need to install the 64 bit client library, the 64 bit ODBC driver, configure it in the 64 bit ODBC Administrator (note that on 64 bit systems you have both a 32 bit and 64 bit ODBC Administrator). The fact that your Firebird server is 32 bit (or 64 bit) is irrelevant; the client side libraries is what matter. – Mark Rotteveel Oct 17 '14 at 07:56

1 Answers1

0

I've encountered the same issue before The only way I could solve it was to do the insert in a EXEC AT Try something like this...

EXEC ('INSERT INTO OPENQUERY(firebirdServer, ''SELECT TEST_ID, AGE FROM firebirdBase'') VALUES (1, 22)') AT 2005server
Spock
  • 4,700
  • 2
  • 16
  • 21