Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2002
    Posts
    1

    Angry Unanswered: 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
    ===============================

  2. #2
    Join Date
    Mar 2002
    Posts
    7
    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
    GO

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •