If you’ve ever used Microsoft Master Data Services (MDS), you’ve probably noticed one of its more annoying limitations: there’s no drag-and-drop interface to reorder attributes within an entity. Want to move 10 attributes from the bottom of a 100-column entity to the top? Get ready to click hundreds of times on those tiny arrow buttons in the UI — one position at a time.
It’s painful. It’s slow. It makes you want to give up halfway and live with a messy data model.
But here’s the good news:
You can do this directly in the database with a quick SQL update — much faster and more controlled.
🧩 The Problem
By default, MDS stores the display order of attributes in the table mdm.tblAttribute, in the column called SortOrder. However, changing that value in the database does not immediately reflect in the MDS web interface, unless you refresh the model’s metadata cache.
Let’s walk through how to move a block of attributes from one position to another — without the endless clicking.
🎯 The Scenario
Say you have an entity with 100 attributes, and you want to move the last 10 (IDs 1668–1675) right after attribute ID 626, which currently has a SortOrder of 18. Here’s how to do it.
⚙️ Step 1: Shift existing SortOrders to make room
We’re going to bump everything after SortOrder 18 up by 8, to make space for our new block.
UPDATE aSET a.SortOrder = a.SortOrder + 8FROM mdm.tblAttribute aWHERE a.Entity_ID=33 AND a.SortOrder>18⚙️ Step 2: Assign new SortOrders to your selected attributes
We now insert our 8 attributes into the newly freed-up SortOrder slots (19–26):
UPDATE mdm.tblAttribute SET SortOrder = 19 WHERE ID = 1668;UPDATE mdm.tblAttribute SET SortOrder = 20 WHERE ID = 1669;UPDATE mdm.tblAttribute SET SortOrder = 21 WHERE ID = 1670;UPDATE mdm.tblAttribute SET SortOrder = 22 WHERE ID = 1671;UPDATE mdm.tblAttribute SET SortOrder = 23 WHERE ID = 1672;UPDATE mdm.tblAttribute SET SortOrder = 24 WHERE ID = 1673;UPDATE mdm.tblAttribute SET SortOrder = 25 WHERE ID = 1674;UPDATE mdm.tblAttribute SET SortOrder = 26 WHERE ID = 1675;🔄 Step 3: Force MDS to recognize the new order
Now here’s the catch: MDS caches metadata, so even though the database is updated, the UI might not reflect your changes. You can force MDS to rebuild by doing one of the following:
Option A: Add and remove a dummy attribute
This is the simplest workaround:
- Go to System Administration > Manage Entity.
- Add a new dummy attribute.
- Save.
- Delete the dummy attribute again.
This will trigger a metadata refresh and your new attribute order will show up.
Option B (cleaner): Export and redeploy the model
Use MDSModelDeploy.exe to export and re-import your model:
MDSModelDeploy.exe exportmdl -model "YourModelName" -version "VERSION_1" -package "yourmodel.pkg"MDSModelDeploy.exe deployclone -package "yourmodel.pkg" -model "YourModelName" -version "VERSION_CLONE"This rebuilds the internal structure and re-applies the correct attribute order.
✅ Final Result
With this approach:
- You control exactly where attributes appear.
- You avoid manually clicking 100+ times.
- You reduce the risk of human error in complex models.
Frequently asked questions
How do I reorder attributes in Master Data Services (MDS) without clicking?
Update the SortOrder column in the table mdm.tblAttribute with a SQL UPDATE. First shift the existing SortOrder values to make room, then assign the new values to the attributes you want to move.
Where does MDS store the display order of attributes?
MDS stores the display order in the column SortOrder of the table mdm.tblAttribute. You can change it with a SQL UPDATE.
Why does the MDS web interface not show my new attribute order?
MDS caches metadata. The database holds the new SortOrder, but the interface does not show it until you refresh the metadata of the model.
How do I force MDS to refresh its metadata after a SortOrder update?
Add a dummy attribute under System Administration > Manage Entity, save, and delete it again. The cleaner option is to export the model and redeploy it with MDSModelDeploy.exe.
How do I export and redeploy an MDS model with MDSModelDeploy.exe?
Run MDSModelDeploy.exe with exportmdl to write the model to a package. Then run it with deployclone on that package to create a new version. This rebuilds the structure and applies the attribute order.
Comments
Related blogs
Keeping Your SQL Server Statistics Fresh: A Guide to Optimal Database Performance
Build your own brain with MyGPT: metadata, logic and answers at your fingertips
AI as your SQL sidekick: how ChatGPT and Claude make your code faster and better