Showing posts with label openquery. Show all posts
Showing posts with label openquery. Show all posts

Wednesday, March 21, 2012

Error 7405 with a linked server and stored procedure

I'm trying to create a stored procecudure using the openquery command to an linked ODBC server.

Everytime I try to save the procedure I get "error 7405: Heterogenous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection."

I've checked everywhere and set these options on, yet it still doesn't work.

Any ideas?

It's a simple procedure and when I type the sql into query analyzer it works.

HELP?

Here is the procedure.
===============================
CREATE PROCEDURE [dbo].[stpDKLink] AS

select * from openquery(dk, 'select * from pub.invoice')

GO
===============================Yes, SQLServer error message is a bit misleading in this case. Try this out:

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE [dbo].[stpDKLink] AS
select * from openquery(dk, 'select * from pub.invoice')
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GOsql

Error 7399 in Openquery. GetNextRow in Informix

When I execute a Select using Openquery against Informix, sometimes I receive the error below:

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [Informix][Informix ODBC Driver]Error in row.]
[OLE/DB provider returned message: sqlerrm(table_name)]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowset::GetNextRows returned 0x80004005: ].

I noticed that the error is occuring when an user is Updating/Deleting or Inserting data in the table at the same time.

Environment:
Windows 2K
SQL Server 2000 with SP 3a
SDK Client 2.81 for Informix
ODBC 3.81 for Informix

Informix 7.3 running on a Unix machineHi,

Do you found any solution about this case? I have the same problem as you. Please send me information if you have some, this will be a big help for me.

Thank you and best regards,
ThinkMan|||Hi Thinkman,

Sorry, but I didnt find any solution for OUR problem.

Norivalsql