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

Not getting results from SQL query

(0) ShareShare
ReportReport
Posted on by 290

Hi,

I'm running the below statement via SO Adminstrator as I want to view the contents of the order table

select * from order;

This statement returns the following error,

An error occurred while executing the query:  Incorrect syntax near the keyword 'order'.

Any clues why?  I can't see anything wrong.

*This post is locked for comments

I have the same question (0)
  • Rob Gresswell Profile Picture
    290 on at
    RE: Not getting results from SQL query

    Putting [ ] round the word fixed the problem.

    Thanks Dann

  • Community Member Profile Picture
    on at
    RE: Not getting results from SQL query

    [Order] is absolutely a valid table (there are multiple stock reports that query it). It holds customer Quotes/Work Orders/Layaways, and there won't necessarily be a corresponding entry in the [Transaction] table (linked via the RecallID field) until a particular order is processed through POS and completed as a transaction.

  • Community Member Profile Picture
    on at
    RE: Not getting results from SQL query

    order is not a valide table.  

    try   SELECT * FROM [TRANSACTION]

    or   SELECT * FROM [TRANSACTIONENTRY]

    if you have years of history these commands will take a long time to complete.   What information are you trying to retrieve?

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Not getting results from SQL query

    'Order' is a reserved term in SQL, which is why you're getting the error. Put it in []'s, and you'll be fine:

    SELECT * FROM [Order]

    (this is also the case with 'Transaction', fwiw)

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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics RMS (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans