Is there any difference between DECIMAL and NUMERIC in SQL Server?

后端 未结 6 860
温柔的废话
温柔的废话 2020-11-28 06:13

Is there any difference between DECIMAL and NUMERIC data types in SQL Server?

When should I use DECIMAL and when NUMERIC?

6条回答
  •  青春惊慌失措
    2020-11-28 06:33

    This is what then SQL2003 standard (§6.1 Data Types) says about the two:

      ::=
        NUMERIC [   [   ]  ]
      | DECIMAL [   [   ]  ]
      | DEC [   [   ]  ]
      | SMALLINT
      | INTEGER
      | INT
      | BIGINT
    
     ...
    
    21) NUMERIC specifies the data type
        exact numeric, with the decimal
        precision and scale specified by the
         and .
    
    22) DECIMAL specifies the data type
        exact numeric, with the decimal scale
        specified by the  and the
        implementation-defined decimal
        precision equal to or greater than the
        value of the specified .
    

提交回复
热议问题