Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

徵狀

假設您是使用 MDS Web 服務,在 Microsoft SQL Server 2012 或 SQL Server 2014 Master 資料服務(MDS)中建立數值屬性。 當您嘗試在小數點右側指定更多位數時,會計算不正確的精確度。 例如:當您嘗試建立小數屬性時,請執行下列動作,以16位數作為精確度:

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

已建立的資料行的小數位數正確,且精度不正確(22)。

原因

出現這個問題的原因是,內部 MDS 儲存程式在您建立屬性時使用了錯誤的精確度計算。 Precision 的計算結果為38減去比例,不正確。

每個新的 SQL Server 累計更新都包含所有的修正程式,以及前一個累積更新中所包含的所有安全性修正程式。 查看 SQL Server 的最新累計更新:

因應措施

若要解決此問題,請根據您的情況,使用下列方法:

  • 針對 SQL Server 2014,請套用修正程式。

  • 若是 SQL Server 2012,請將預存程式變更為使用常量值38(SQL Server 2012 允許的最大值),而不是從精度減去小數位數(@DataTypeInformation 等)。

狀態

Microsoft 已確認本篇文章<適用於>一節所列之 Microsoft 產品確實有上述問題。

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×