Master Data Services : Display entity members with good sort order when code is numeric

a MDS user recently asked me this question:

When looking at entity contents via web UI in the column code, 10 and each code that starts with 1 (10,11..19) always goes before 2 and so on. Is there any way to fix it? I don’t believe that’s the right order.



so I’ve started to investigate..

first (easy solution)

the easiest way is to add at least one zero before code “1” and code  “2” and so on

but if your code size is huge, you will have to add a lot of “0” behind your code

so I’ve tried to find a custom hack in MDS stored procedure: and finally I’ve found it 🙂

second (hard way) solution:

after a few search on google, I’ve found this post :

but I had to find where to place this code hack

after a few search on mds (by sorting entity members in Web UI and looking at SQL profiler)

i’ve found that a call was made to this stored procedure:


after looking into udpEntityMembersGet, I’ve found that another stored procedure was called : mdm.udpMembersGet, a huge one!

so I’ve tried to update this SP code and finally it works!

be carefull, this hack could slow down the entitymembers get request, and it is only for testing purpose, and if you update MDS with cumulative update, it could be erased!

you just have to replace every instance of (there should be 3 of them) :






 right click here and ‘save as’ to download the customized stored procedure


Bookmark the permalink.

About Xavier

7 years+ .net consulting

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha * Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.