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 AX (Archived)

ForceLiterals and ForcePlaceholders in General Optimization of Query

(0) ShareShare
ReportReport
Posted on by

What's the difference between ForceLiterals ,  ForcePlaceholders in context of optimal queries ?   What  are actually these terms and where to be used ?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    There are already a lot of forum topics, blogs and documentation on the matter, you should use a search engine to find them.

    Such as this one:

    community.dynamics.com/.../147969

    They do more harm than good in majority of the cases, but there could be some special select statements where you want the SQL Server Query optimizer engine to act in a specific way, which could be manipulated by using those keywords.

    The AX kernel is using it for example to avoid parameter sniffing by enabling literals for DataAreaId field, so each company would get their own query execution plan for optimum performance by having a hardcoded DataAreaId value.

    https://blogs.msdn.microsoft.com/axinthefield/sql-server-parameter-sniffing-with-dynamics-ax-just-plain-evil-redux-5-19-2014/

  • Vilmos Kintera Profile Picture
    46,149 on at

    Kindly mark helpful answers as verified next to each post with the checkbox, thank you.

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 March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans