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

Free webinar – Tackling the Gaps and Islands Problem with T-SQL Window Functions

I'm hosting a free webinar at MSSQLTips.com at the 19th of December 2024, 6PM UTC.…

5 days ago

dataMinds Connect 2024 – Session Materials

The slides and scripts for my session "Tackling the Gaps & Islands Problem with T-SQL…

4 weeks ago

Connect to Power BI as a Guest User in another Tenant

Sometimes your Microsoft Entra ID account (formerly known as Azure Active Directory) is added as…

2 months ago

How to use a Script Activity in ADF as a Lookup

In Azure Data Factory (ADF, but also Synapse Pipelines and Fabric Pipelines), you have a…

4 months ago

Database Build Error – Incorrect syntax near DISTINCT

I wrote a piece of SQL that had some new T-SQL syntax in it: IS…

4 months ago

Speaking at dataMinds Connect 2024

I'm very excited to announce I've been selected as a speaker for dataMinds Connect 2024,…

5 months ago