web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Heterogeneousqueries requiere the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection.

(0) ShareShare
ReportReport
Posted on by 550

I am running a procedure with a linkserver and I have this error:

"Heterogeneousqueries requiere the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection.

I set the ANSI_NULL and ANSI_WARNINGS in my procedure but the error persist. I running the procedure in Great Plains by Visual Basic.

How Can I fix this issue?.

5672.Error.PNG

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Tim Wappat Profile Picture
    5,713 on at

    I think this is the same as this question:

    community.dynamics.com/.../47517

    So you need to create your own connection with the correct settings on the connection.

    Tim.

  • Suggested answer
    MG-16101311-0 Profile Picture
    26,225 on at

    There are usually two things you need to do at the same time to overcome this issue:

    1. You need to make sure you encase your stored procedure with the following:

    SET ANSI_NULLS ON
    GO
    SET ANSI_WARNINGS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE dbo.SomeProcedure AS
    BEGIN
    
     -- do something
    
    END
    GO
    


    2. Next, you will want to use some sort of impersonation to access the linked server where the above procedure exists. Your stored procedure should perform actions locally on the server where you want to read, update, or write data. The call from your application should be to the stored proc on the linked server.

  • Carolina Hernandez Profile Picture
    550 on at

    I fix the ODBC with the parameters and run successful .

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
talty09 Profile Picture

talty09 2

#1
Anthony Beatty Profile Picture

Anthony Beatty 2

#3
CP04-islander Profile Picture

CP04-islander 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans