Master Data Services (MDS): Miscellaneous tips

I have come across a number of tips while using MDS.  These are tips not big enough for their own blog post, so I list them all here:

  • To “hide” an attribute in the MDS Excel add-in, set the pixel width to “0”
  • If you make a change outside of the Master Data Manager Web User Interface “UI” (i.e. Master Data Services Configuration Manager, MDSModelDeploy tool, etc), you should go to the home page of the UI and click “Refresh cached information” on the top right of the screen
  • The Master Data add-in for Excel allows you to modify an attributes type and length, but the MDM web UI does not allow this (those boxes are grayed out).  So just fire up your Excel if you find you need to change an attributes type and length
  • There is not a way in the MDM web UI to delete a version.  You must manually delete it: Delete a Version (Master Data Services)
  • To get data into and out of the system and communicate with other applications, Master Data Services uses staging tables for the incoming data flow and subscription views for the outgoing data flow
  • In MDS, to track history of data changes (called Change Tracking), in the MDS web UI go to Version Management -> Transactions (see Transactions).  It’s not at the level of your typical Type 2 slowly changing dimension, but you can reverse transactions and add comments
  • In a subscription view, each domain-based entity shows as three fields: 1) EntityName_Code – This equals the “Code” field in the referenced domain, 2) EntityName_Name – This equals the “Name” field in the referenced domain, 3) EntityName_ID – Internal system key for the member
  • In the MDS web UI, in Explorer, a delete sets a member to de-activated (a soft delete).  You can reverse this via the Transaction screen (on my project, instead of doing soft deletes, we created a field called  MasterDataStatus that contains “Active” and “Deprecated”).  You can hard delete members through the Entity Based Staging feature in MDS via SSIS…you just need to set the ImportType to 4 or 6 when you prepare the staging table.  This is probably going to be enhanced in the first service pack of SQL 2012 by adding a new stored procedure that will hard-delete old soft-deleted members from a given model so you don’t have to use Entity Based Staging
  • There is no easy way via the MDS web UI to do mass soft deletes to members in a entity – they can only be done one-by-one.  So, you can use the Entity Based Staging feature in MDS via SSIS to do a mass soft delete (by setting the ImportType to 3), or even easier use the Master Data Services add-in to Excel to quickly do a mass soft delete.  A soft delete de-activates a member
  • In the MDS web UI, “Integration Management -> Import Data” shows all the batches In mdm.tblStgBatch with a status_id: 1 (QueuedToRun), 3 (Running), 4 (QueuedToClear), 5 (Cleared), 7 (Completed).  You will see batches with a status of “NotRunning” if there are records in any of the staging tables with a batch_ID of NULL (mdm.tblStgBatch is not used for those). So to remove those batches from this screen, delete those records from the staging table, such as: “delete from stg.FMD_TablArea_Leaf where batch_ID is null and BatchTag = ‘Area';”
  • MDS Staging was vastly improved in the SQL Server 2012 MDS release and is called Entity Based Staging.  Watch this video intro and refer to the product documentation on the new 2012 MDS staging concepts.  Also become familiar with Leaf Member Staging Table
  • You should routinely clear the completed batches via the MDS web UI: Integration Management -> Clear Batches.  Otherwise, these tables will grow large and batching the stage data will be slow
  • To view staging errors, run SQL such as (see Staging Process Errors for error details): SELECT * FROM [MDS2012].[stg].[FMD_TblFacility_Leaf] stg LEFT OUTER JOIN [MDS2012].[mdm].[tblErrorCodesMapping] ecm on stg.ErrorCode = ecm.Bitmask LEFT OUTER JOIN mdm.tblDBErrors dbe ON dbe.ID = ecm.UniqueErrorCode LEFT OUTER JOIN mdm.tblStgErrorDetail sed ON sed.Batch_ID = stg.Batch_ID AND sed.Code = stg.Code AND ecm.UniqueErrorCode = sed.UniqueErrorCode where ImportStatus_ID = 2 and stg.Batch_ID = 1197
  • The “Create Code values automatically” checkbox that is available when creating an entity automatically generates values for an entity’s Code attribute when you want an integer to be automatically assigned to the Code value each time a new member is created.  In the staging process set the Code field to NULL (or in the Excel add-in leave it blank) to have it automatically generate the next integer value.  This is similar to the IDENTITY column in SQL Server.  Note that you are not prevented from entering other values for codes; rather an initial value is automatically set.. See Automatic Code Creation.  This feature is new to SQL Server 2012.  In SQL Server 2008 you needed to use a business rule to automatically generate values for the Code field: See Auto-Generating a Master Data Member Code
  • MDS has a trace logging feature that is useful for error diagnostics and support requests as well as monitoring of application usage and performance.  More info is at How to enable Trace Logging in SQL Server 2008 R2 Master Data Services (NOTE: make sure the directory where the log file will be has write access on it for everyone)
  • You can display pages from the Master Data Manager Web User Interface within SharePoint and crop the headings and menus so that it’s displayed more naturally. See Display the Master Data Services Web Application in SharePoint
  • Master Data Services requires SQL Server’s Service Broker to be running to process batches.  If on the Import page, in the Unbatched Staging Records pane, the status remains QueuedtoRun, you need to enable service broker
  • MDS uses nvarchar for everything, making things difficult if your source system uses varchar.  So you have to convert from varchar to nvarchar in SSIS using the data conversion task to get data into MDS
  • MDS stores dates as datetime2(3) which will cause a compare in T-SQL to a field with datetime to not match.  So keep this in mind so when doing a compare as both fields should use the CONVERT statement to be converted to the same date type

About James Serra

James currently works for Microsoft specializing in big data and data warehousing using the Analytics Platform System (APS), a Massively Parallel Processing (MPP) architecture. Previously he was an independent consultant working as a Data Warehouse/Business Intelligence/MDM architect and developer, specializing in the Microsoft BI stack. He is a SQL Server MVP with over 25 years of IT experience.
This entry was posted in MDS/MDM, SQLServerPedia Syndication. Bookmark the permalink.

20 Responses to Master Data Services (MDS): Miscellaneous tips

  1. Sonia says:

    Thank you for sharing these tipps. Very helpfull.

  2. Frank says:

    Hi James,
    Did you do an evaluation of the pro/cons betweew Microsoft SQL Serve and MDS? If so can you share your findings.
    Thanks,
    Frank

  3. Frank says:

    James,
    Thanks for getting back so soon.
    Looling for the difference between MDS (new product) and using an industrial strength application like SQL Server to impliment an MDM solution
    thanks

  4. Antonette Campbell says:

    Is functionality available in the MDS Web UI that is similar to the “Publish” in the Excel Add-In?
    We would like the user to batch his changes in the UI and then click Publish or something to start our notification process. We don’t want to be notified for every change.
    Thanks

  5. Hi James,

    I am using MDS to do some heavy data management on a dataset in around 130000 records. My problem is that the Excell add-in is awfull slow when loading the data. Is there any way to speed up the loading other than work with a smaller dataset?

    Best Regards
    Kenneth

  6. Joe says:

    Very handy query to get Error details James, many thanks. JK

  7. kiki says:

    Hi
    I have a question about staging: i have two rows with the same code, i want to load both of them into MDS UI, but MDS staging will not accept the same member code twice. How should I solve it?
    For instance:
    Code: 12345, Attribute1: 001
    Code:12345, Attibute2:002
    I want to load both rows together at the same time.

    • Joe Kelly says:

      You will have to transform the data to get both Attribute changes on to the one line.

      • kiki says:

        Hi
        Thanks for your reply. I am new with MDS, so I am not sure how to transform the data to get both Attribute changes on to the one line.

        Data source(code:12345, type:001; code:12345, type:002)–>conditional split( Code==Code)–>match output->derived column(create new column: type2)
        Am I right?

  8. Nick Samuel says:

    Hi James,

    I have been looking at MDS for a specific name-maintenance task and I have worked out how it can cover every requirement except one. If somebody changes the name of a member (same thing, different name), can I use MDS to to see this? I need to report from an anther database and would need both names for continuity using MDS as the reference source.

  9. James, Quick question regarding “change tracking entities attributes” and their relationship to Data Warehouse Type 2 Dimensions. Unless I am missing something MDS cannot support pulishing the changes via views with a datatime stamp. so it would seem the best way to accomplish this is to insert a custom process thta will take the published view (MDS) and update the Data Warehouse Dimension (Type 2) , in essence manually.

  10. Curious MDS developer says:

    Hi James,

    Are you familiar with the email notification functionality tied to business rule validation. Have you set this up in the past at your organization?

  11. Susheel says:

    Hi James,

    End users would like to capture all the changes to any attributes within an entity.
    Currently in the DB I see any change to the attribute value, the record gets updated with User ID and Data-time stamp.
    I am trying explore in MDS 2008 to see if its possible to set up a SCD Type-2?
    Capture every change in a separate record in the DB.

    thanks,
    Susheel

  12. Tony says:

    Hi James,

    I am working on a MDS project that utilizes the Excel add-on as the UI tool for the business users. One of the attributes is domain based, and both the name and code both show up in the same column in Excel (in this case it is store name and store #).

    The business users want these separated into two columns so they can sort/filter by either store name or store number. Is there a way to separate this domain attribute into two columns in the Excel add-on?

    Thanks,

    Tony

    • Joe says:

      As it is a Domain attribute, the code cannot be changed in the referenced entity, so the Name/Code (or just the name is an option) is displayed as there is only one column/Attribute in that Entity.
      If they can see both Name and Code in the text displayed, can they not still filter on either ?

  13. Mike Honey says:

    Thanks so much for sharing this James – its a dense gold-mine of MDS nuggets. Your point on the domain-based attributes (generating view columns of *_Code and *_Name) got me onto the root cause and workaround for this issue: https://connect.microsoft.com/SQLServer/feedbackdetail/view/958374/mds-domain-based-attribute-name-conflicts-with-other-attributes

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>