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

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Trigger on RM00101

(0) ShareShare
ReportReport
Posted on by

We feed a sister system with customer data that's entered on GP 9.0. I have a central database (MSTR) that houses all the customers then there is a trigger on the RM00101, 102 and 103 that blows the data out to the other 43 companies that we have on GP. That works fine-it's all on the same server.

The trigger that doesn't work sends it to a linked server that's also SqlServer 2005. When I enter the data (in GP/Cards/Sales/Customer) and hit save I get:

[Microsoft][ODBC SQL Server Driver][SQL Server]Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query.
EXCEPTION_CLASS_DB
DB_ERR_SQL_OBJ_NOT_FOUND

I've modified my ODBC setting that I log into GP with and that doesn't help. Are ANSI_NULLS/ANSI_WARNINGS set by the application?!?! If it is, I'm screwed. From what I've read online, you can't change these settings from a trigger, it HAS to be the application and/or Enterprise manager that does this. Surely someone has had to do a trigger off new customer additions.

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    Re: Trigger on RM00101

    I should also add that the linked server was done through SQLNCLI  - native client NOT odbc. I know that I attach through ODBC to get to GP. Should I try to create the linked server as ODBC connection?

  • Community Member Profile Picture
    on at
    Re: Re: Re: Trigger on RM00101

    Sorry, that still doesn't work. I tried that yesterday.

    From what I understand the 'Set' commands are done from the application as the CONNECTION object. You can't 'set' these options from the trigger.

  • Community Member Profile Picture
    on at
    Re: Re: Re: Re: Re: Trigger on RM00101

    Then what would you suggest?  Maybe a stored procedure that runs at a certain time? That's how I currently have it but it's an application, not a trigger/sproc.

     I just thought since they were both Sql Server that I could check the inserted table and act accordingly.

  • winthropdc Profile Picture
    on at
    Re: Re: Re: Re: Re: Re: Re: Trigger on RM00101

    Your trigger code will need to change the ANSI settings and then call a second stored procedure and then change them back.  Changing the ANSI settings does not take effect in the current script and needs you to call a second script which now executes in the new context.

    I had to do the same thing when working across two servers.  There is a KB article about this somewhere.

    David

    David Musgrave [MSFT]
    Escalation Engineer - Microsoft Dynamics GP
    Microsoft Dynamics Support - Asia Pacific

    Microsoft Dynamics (formerly Microsoft Business Solutions)
    http://www.microsoft.com/Dynamics

    mailto:David.Musgrave@online.microsoft.com
    http://blogs.msdn.com/DevelopingForDynamicsGP

    Any views contained within are my personal views and not necessarily Microsoft policy.
    This posting is provided "AS IS" with no warranties, and confers no rights. 

  • Community Member Profile Picture
    on at
    Re: Trigger on RM00101

    Mr. Musgrave:

    Thanks soooo much for your reply. I have to admit I haven't done that much SqlServer trigger coding. Do you have an example of what it should look like?

    Is it as simple as:

    Create trigger --- as Set ANSI_NULLS On GoExec  InsertNewCust(---)

     

  • John Kang Profile Picture
    40 on at
    Re: Re: Re: Trigger on RM00101

    Our company is having this exact same issue after we added a new server recently and this solution doesn't seem to work.  Is this a fully tested and documented solution or "should work" thing?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans