Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. What is decimal data type in sql server?

What is decimal data type in sql server?

Scheduled Pinned Locked Moved ASP.NET
questiondatabasesql-serversysadmin
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rockstar_
    wrote on last edited by
    #1

    Hi, I have a column of type decimal(18,0)? What it can store?

    J 1 Reply Last reply
    0
    • R Rockstar_

      Hi, I have a column of type decimal(18,0)? What it can store?

      J Offline
      J Offline
      JammoD87
      wrote on last edited by
      #2

      The Decimal Data type can store exactly that, a decimal value. Within your example the 18 means, the number of digits that can be stored and the 0 us the number of digits that can be stored to the right of the decimal point. See http://www.w3schools.com/sql/sql_datatypes.asp[^] Thanks,

      Personal Blog: A Software Programmer Twitter: JammoD

      G 1 Reply Last reply
      0
      • J JammoD87

        The Decimal Data type can store exactly that, a decimal value. Within your example the 18 means, the number of digits that can be stored and the 0 us the number of digits that can be stored to the right of the decimal point. See http://www.w3schools.com/sql/sql_datatypes.asp[^] Thanks,

        Personal Blog: A Software Programmer Twitter: JammoD

        G Offline
        G Offline
        greymatterindiaseo
        wrote on last edited by
        #3

        In MySQL DB....

        decimal(4,2) allows entering only a total of 4 digits. As you see in decimal(4,2), it means you can enter a total of 4 digits... out of which two digits are ment for keeping after the decimal point.

        So, if you enter 100.0 in MySQL database, it will show an error like "Out of Range Value for column".

        So, you can enter in this range only .... 00.00 to 99.99

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups