Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8529755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:06:07+00:00 2026-06-11T09:06:07+00:00

This one is pretty straightforward. Why does the code below cause the error below?

  • 0

This one is pretty straightforward. Why does the code below cause the error below?

declare @dTest decimal(10, 9)
set @dTest = 50

Error:

Msg 8115, Level 16, State 8, Line 3
Arithmetic overflow error converting int to data type numeric.

According to the MSDN documentation on decimal(p, s), p (or 10 in my case) is the “maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point” whereas s (or 9 in my case) is the “maximum number of decimal digits that can be stored to the right of the decimal point.”

My number, 50, has only 2 digits total (which less than the maximum 10), and 0 digits to the right of the decimal (which is less than the maximum 9), therefore it should work.

I found this question about essentially the same issue, but no one explained why the documentation seems to conflict with the behavior. It seems like the s dimension is actually being interpreted as the fixed number of digits to the right of the decimal, and being subtracted from the p number, which in my case leaves 10 – 9 = only 1 digit remaining to handle the left side.

Can anyone provide a reasonable way to interpret the documentation as written to match the behavior?

EDIT:

I see some explanations below, but they don’t address the fundamental problem with the wording of the docs. I would suggest this change in wording:

For “p (precision)” change “The maximum total number of decimal digits that can be stored” to read “The maximum total number of decimal digits that will be stored”.

And for “s (scale)” change “The maximum number of decimal digits that can be stored to the right of the decimal point.” to “The number of decimal digits that will be stored to the right of the decimal point. This number is substracted from p to determine the maximum number of digits to the left of the decimal point.”

I’m going to submit a bug report to Connect unless some one has a better explanation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:06:09+00:00Added an answer on June 11, 2026 at 9:06 am

    I submitted a bug report to Connect: Misleading documentation on the decimal data type

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay this one's pretty straightforward. I'm creating a checkbox in my Page.xaml.cs file, and
This one seems like it should be pretty straightforward, but I couldn't quite figure
This one has me pretty rattled so I thank you in advance for your
I'm pretty confused by this one and can't think of anything obvious that I
I've been pretty puzzled by this one. It seems as though my implementation of
Im still pretty new so bear with me on this one, my question(s) are
Normally I'm pretty competent with CSS but I just can't figure this one out...
Okay, I need help. I'm usually pretty good at SQL queries but this one
I'm reading this introductory book on parsing (which is pretty good btw) and one
This seems like a pretty straightforward thing to do, but I can't find anything

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.