Skip to main content

Notifications

Announcements

No record found.

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

  • Rob Gresswell Profile Picture
    Rob Gresswell 290 on at
    RE: Not getting results from SQL query

    Putting [ ] round the word fixed the problem.

    Thanks Dann

  • 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.

  • 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
    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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,575 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans