Skip to main content
Post a question

Notifications

Community site session details

Community site session details

Session Id : MW1+j/0D5sH45bf7PE9E0l
Microsoft Dynamics RMS (Archived)

Not getting results from SQL query

Like (0) ShareShare
ReportReport
Posted on 19 Mar 2013 14:07:50 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
    290 on 26 Mar 2013 at 10:58:12
    RE: Not getting results from SQL query

    Putting [ ] round the word fixed the problem.

    Thanks Dann

  • Community Member Profile Picture
    on 25 Mar 2013 at 13:26:55
    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 23 Mar 2013 at 22:28:49
    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 19 Mar 2013 at 15:04:31
    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March 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... 293,425 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,557 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Loading complete