Symptoms

Assume that you create a Numeric attribute in Microsoft SQL Server 2012 or SQL Server 2014 Master Data Services (MDS) by using the MDS Web Service. When you try to specify more digits to the right side of decimal points, the incorrect precision is calculated.

For example:
When you try to create a decimal attribute that has 16 digits precision by doing:

MetadataAttribute newAttribute = new MetadataAttribute(); 
newAttribute.DataType = AttributeDataType.Number;
newAttribute.DataTypeInformation = 16;


A column is created that has the correct Scale of 16 and incorrect Precision of 22.

Cause

The issue occurs because an internal MDS stored procedure uses the wrong precision calculation when you create the attribute. The precision is calculated as 38 minus the scale, which is incorrect.

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:


Workaround

To work around the issue, use the following methods that are appreciated for your situation:

  • For SQL Server 2014, apply the fix.

  • For SQL Server 2012, change the stored procedures to use a constant value of 38 (max allowed by SQL Server 2012) instead of subtract scale (@DataTypeInformation, and so on) from the Precision.

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

What affected your experience?

Any additional feedback? (Optional)

Thank you for your feedback!

×