Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

attempt to sort an SQL view gives unexpected results

Posted on by Microsoft Employee

Hello Everybody.

We are working with GP10 and we are trying to build a little solution using manufacturing table PK010033 and some eXtender fields and other data stored in SQL tables.

To consolidate the data we built a view that joins all the various tables and views -

We want to sort the view based on the ITEMNMBR field in table PK010033.

Everything seems right, until we scroll pretty far down the output, and then we notice some lines are not in the proper sort order, but cannot figure out why.

We have tried everything we can think of, but no luck so far.

Any ideas? or suggestions what we might try?

Thank you,

Maria.

*This post is locked for comments

  • Suggested answer
    Andrew John Dean Profile Picture
    Andrew John Dean 1,337 on at
    Re: attempt to sort an SQL view gives unexpected results

    Is the 'order by' internal to the view or 'external'. Having the 'order by' internal to the view does not guarantee that the result set will be sorted correctly. To ensure it is sorted correctly try using TOP PERCENT 100 inside the view. If you are doing the 'order by' external ie. select * from view order by col then I don't know what would be causing the problem.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans