Categories: MDS

Master Data Services – Database Error has Occured when Publishing Business Rule

I was preparing a demo for a session about the new features of Master Data Services in SQL Server 2016. In that demo, I created a business rule to test out the extension with custom scripts. When the business rule was finished, I tried to publish it. But, I was greeted with the following error: “300 – A database error has occurred. Contact your system administrator”.

Not the most helpful error message, especially when you are the admin yourself. The MDS team promised that in SQL Server 2016, troubleshooting would be easier. So I went and checked out their blog post What’s New in Master Data Services – SQL2016 CTP2 (May) Release, where they have a section Improved Troubleshooting and Logging.  There it is mentioned the web application logs to the following folder: C:\Program Files\Microsoft SQL Server\130\Master Data Services\WebApplication. In the log file over there, I could find the following – actual – error message:

VIEW SERVER STATE permission was denied on object ‘server’, database ‘master’

Apparently during the publishing of a business rule, MDS wants to run a stored procedure called udpValidationIsRunning. This procedure wants to check the system view sys.dm_broker_activated_tasks and apparently the necessary permissions are lacking.

The fix is luckily quite easy: just run the following statement to grant the permission to the MDSAppPool security group:

USE MASTER;
GRANT VIEW SERVER STATE TO [yourmachine\MDSAppPool];

Now the business rule can be published without an issue.

UPDATE:

it’s possible to logs are located at the folder C:\Program Files\Microsoft SQL Server\130\Master Data Services\WebApplication\MDSTempDir. This might have been changed in a later CU.


------------------------------------------------
Do you like this blog post? You can thank me by buying me a beer 🙂
Koen Verbeeck

Koen Verbeeck is a Microsoft Business Intelligence consultant at AE, helping clients to get insight in their data. Koen has a comprehensive knowledge of the SQL Server BI stack, with a particular love for Integration Services. He's also a speaker at various conferences.

View Comments

  • Great!!

    I was spinning my head around this problem and this solved it for me! :)
    Although, that account might be different from the one you show.

    Thanks, Koen

  • Hi, I have created three types business rule in one column
    1. Must be unique
    2. is required
    3. must be less than 99999999

    when I publish first two MDS will not give me error and published the rules, but when I publish third rule it gives me error "Errors • 156 : A database error has occurred. Contact your system administrator. "

    Can anyone guide me about this error

    1

  • Hi Koen,
    how can I check log?
    but i have started profiler and checked calls of SQL Statement and I saw error in mdm.[udp_SYSTEM_1_14_CHILDATTRIBUTES_ProcessRules] procedure when I click on publish and I can see the syntax error there .below is the query where error occurred,you can see in case statement..there is nothing after md.[AnnualLeaveCredits] <

    SELECT
    md.MemberID
    ,5 AS BusinessRuleID
    ,19 AS BRItemID
    ,N'AnnualLeaveCredits must be less than ' AS RuleItemText
    ,ce.IsConditionTrue
    ,CASE WHEN
    md.[AnnualLeaveCredits] < THEN 0 ELSE 1 END AS IsRuleBroken
    ,CASE WHEN iss.MemberID IS NOT NULL THEN 1 ELSE 0 END AS HasExistingIssue
    FROM #BRMemberData AS md
    INNER JOIN #BRConditionEvaluation AS ce
    ON md.[MemberID] = ce.[MemberID]
    AND ce.[BusinessRuleID] = 5
    LEFT JOIN cteCurrentValidationIssues iss
    ON ce.[MemberID] = iss.[MemberID]
    AND iss.[BusinessRuleID] = ce.[BusinessRuleID]
    AND iss.BRItemID = 19 ),

    • It's described in the article how to find the log:

      The MDS team promised that in SQL Server 2016, troubleshooting would be easier. So I went and checked out their blog post What’s New in Master Data Services – SQL2016 CTP2 (May) Release, where they have a section Improved Troubleshooting and Logging. There it is mentioned the web application logs to the following folder: C:\Program Files\Microsoft SQL Server\130\Master Data Services\WebApplication. In the log file over there, I could find the following – actual – error message

      Regarding the error in the case statement: what if you use a smaller number?

  • Koen it says we can find log folder under web application but I am not able to see any log folder under web application folder. Can u help me!!

  • Koen I have tried lower value I was publishing value 99 and now I am publishing value 5 but error remains same..there is syntax error in query .Value should be present after < sign
    you can see in case statement of query ,CASE WHEN md.[AnnualLeaveCredits] <

    SELECT
    md.MemberID
    ,6 AS BusinessRuleID
    ,22 AS BRItemID
    ,N'AnnualLeaveCredits must be less than ' AS RuleItemText
    ,ce.IsConditionTrue
    ,CASE WHEN md.[AnnualLeaveCredits] < THEN 0 ELSE 1 END AS IsRuleBroken

  • Hi Koen,
    Microsoft has confirmed that it's a bug, we have to update our Master data services 2016 to MDS 2016 SP1 Cu2. Thank you so much for your time. :)

  • koen.. Can we auto retrieved the column value from other column is it possible in MDS. For Example if we have column A (ID Number Column) value 7407195189089 then Column B (Data of Birth Column) value should be auto retrieved from Column A value , I this case the first 6 digits of column A is the Data of birth of Employee, so Data of Birth should be auto retrieved from ID number In this case the Date of Birth Value (first 6 digits of ID Number) should be 1974-07-19.
    Can we do this?

    • I'd say MDS is not the place for this. This is something your ETL should do, or the process that inserts the master data into MDS.
      MDS should be used for storing master data and validating it.

  • Hi Koen,

    I have updated SQL server 2016 to SQL server 2016 SP1 Cu2, after updation my database server is updated to Microsoft SQL Server 2016 (SP1-CU2) (KB4013106) - 13.0.4422.0 (X64) ,Master data services version is changed from 13.1.4001.0 to (Now MDS version is 13.1.4422.0), now I am receiving error on MDS website which I was using before is " The product version and database version are not compatible. " , Can you please guide me.

  • Hi Koen,
    How can we add Business rule or validation on Column which has year input, For example user can only enter year like 2017 or 2016 or 2015 etc etc ...user cannot enter more than 4 digits and 4 digits should be year. Can we achieve this in MDS??

Recent Posts

Book Review – Agile Data Warehouse Design

I recently read the book Agile Data Warehouse Design - Collaborative Dimensional Modeling, from Whiteboard…

4 days ago

Cloudbrew 2024 – Slides

You can find the slides for the session Building the €100 data warehouse with the…

1 week ago

Book Review – Microsoft Power BI Performance Best Practices

I was asked to do a review of the book Microsoft Power BI Performance Best…

1 month ago

Create a Numbers Table in Power Query

This is a quick blog post, mainly so I have the code available if I…

1 month ago

Microsoft finally adds Tenant Switcher for Fabric / Power BI

Praise whatever deity you believe in, because it's finally here, a tenant switcher for Microsoft…

1 month ago

Book Review – Humanizing Data Strategy by Tiankai Feng

This book was making its rounds on social media, and the concept seems interesting enough…

1 month ago