SQL 2008 R2 Master Data Services : Bulk Data Insert with API

In this article, I will talk about Master Data Services.
You can find the source code of this example on my MDS project on Codeplex:

Special thanks to Suzanne Selhorn at Microsoft for help and support and her new great book about Master Data Services that you can find on Amazon :

Update 30 april 2011
a part of a answer message from Tyler Graham about synchronous /asynchronous operations:
 I wanted to ensure you understood that EntityMembersCreate and its partners calls are synchronous calls that will return any and all errors founds in the MDS load. (More so in Denali where some problems have been fixed)  ModelMembersBulkMerge and any calls with the ‘Bulk’ keyword leverage staging and will return success no matter what the disposition of the records as the use of staging is asynchronous.”

thanks to Tyler for this useful remark!

Note : 
EntityMembersCreate : only new member records with unique codes can be created with this operation. If a member code already exists, an error will be thrown in the returned error collection and the member will not be created or updated.

EntityMembersMerge : Many users have been confused by this operation and believe it has something to do with record survivorship or match merge functionality. This operation does nothing to look for possible matches or provide any survivorship functionality; it only allows users to create and update records simultaneously within MDS.
Information source : 
book: Master Data Services “Implementation and Administration” by Tyler Graham and Suzanne Selhorn
So, what’s the point:

you want to insert a big number of members in a MDS entity, with API (MDS WebService)
first solution :

Second Solution :

So let’s see the 2 solutions in details :

First solution  : (slow, not recommanded)
inserting each member with API method EntityMembersCreate


Second Solution : with API method ModelMembersBulkMerge (fast, recommanded)

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.