3

I'm trying out Microsoft Master Data Services and I would like to add data to the database programmatically. I'm starting to get the model/entity/member structure but I'm not yet sure. If you have a nice explanation for this structure, please share.

Say somebody added a new employee in an ERP system and I would like to send that to the MDS. How would I do that? Is the data that I want to add a new member? Because if I look at the following information (http://technet.microsoft.com/en-us/library/hh230995), the only way to import data is through entities?

Thanks in advance for any useful information about this!

hhoud
  • 518
  • 2
  • 6
  • 18

3 Answers3

4

Lets start with the basics.

  • Entities in Master Data Services (MDS) are roughly analogous to tables in a regular database.
  • Every entity must live in a model.
  • A model can contain any number of entities.

The Metadata* methods you see on that page can be used to create, read and update models and entities. Once you have modeled your ERP tables as an MDS model, you can use the EntityMembersCreate API (with the relevant model/entity information) to create a member (roughly analogous to a row in a table). You can use EntityMembersUpdate to update members and EntityMembersDelete to delete them.

Another way to get large amounts of data into MDS is by using Entity Based Staging. Entity Based Staging allows you to use tools like SSIS to get bulk data into MDS. A good primer here: http://msdn.microsoft.com/en-us/sqlserver/hh802433.aspx.

I hope this helps. Feel free to ask more questions.

Arun
  • 800
  • 1
  • 7
  • 18
  • This helps indeed but I have some more questions. First of all, if I have data coming from multiple places having different structures, how can I best setup my model? For instance an excel file only contains full name and mobile, an sap instance contains ID, full name, unit, status, ... In the MDS I'd like to have 1 model "employee" containing all the data but I don't want the excel to contain more information than Full Name and Mobile. – hhoud Oct 16 '12 at 07:48
  • I can't enter data in MDS, although I see with Wireshark that the message is passing correctly. I've tried using a demo application to create a member and it was saying that the model was invalid. Do you know how I can fix this or where my problem could be? – hhoud Oct 18 '12 at 15:10
  • First question first. You are talking about getting metadata from multiple systems into MDS. You can set up your model with an entity that has all the fields you need to store. You can use Model object security (http://msdn.microsoft.com/en-us/library/hh231026.aspx) to restrict access by user or security group to the attributes that store extended data. You can use the Excel add-in to get the data that is in Excel into the model and staging to get data from SAP in there. Of course you will have to come up with some sort of unique key to map the data from the two sources. – Arun Oct 19 '12 at 06:42
  • The second question. I am assuming you are talking about using the API to enter data. There are some great samples here http://sqlserversamples.codeplex.com/wikipage?title=SQL%20Server%202012%20Master%20Data%20Services that you should use to get started. If those still don't work, please ask another question and stick your code in there. Remember to tag it master-data-services and I'll have a look. Not enough room in these comments for code :( – Arun Oct 19 '12 at 06:49
  • I had found these code samples already and they were very helpful indeed! In the mean time I think it should work but I can't access my service nor mds website from a remote computer. Do you know which authentication or configuration changes I should do to be able to access it remotely? – hhoud Oct 19 '12 at 07:30
0

I like using a generic data-access-object that classes in my model inherit from. Each class has a one to one relationship with tables in the database.

0

We're using SSIS to replicate data from our CRM (as well as other data sources) into our MDS (for the time-being). If you're not familiar with the tool, I'd recommend in terms of moving data around - it's relatively easy to pickup the basics. If you go this route, here's a great resource I followed to push data into our MDS system:

http://www.sqlchick.com/entries/2013/2/16/importing-data-into-master-data-services-2012-part-2.html