类型映射

https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql-server-data-type-mappings

C#关键字

decimal

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/decimal

The decimal keyword indicates a 128-bit data type.

Compared to other floating-point types, the decimal type has more precision and a smaller range, which makes it appropriate for financial and monetary calculations.

The approximate range and precision for the decimal type are shown in the following table.

取值范围(-7.9 x 1028 to 7.9 x 1028) / (100 to 1028)

精度28-29 significant digits

int

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/int

int denotes an integral type that stores values according to the size and range shown in the following table.

取值范围-2,147,483,648 to 2,147,483,647

大小Signed 32-bit integer

SQL Server中

https://docs.microsoft.com/en-us/sql/t-sql/data-types/decimal-and-numeric-transact-sql

Numeric data types that have fixed precision and scale. Decimal and numeric are synonyms and can be used interchangeably.

decimal[ (p[ ,s] )] and numeric[ (p[ ,s] )]
Fixed
precision and scale numbers.

When maximum precision is used, valid
values are from - 10^38 +1 through 10^38 - 1.

The ISO synonyms for decimal are dec and dec(p, s).

numeric is functionally equivalent to decimal.

p (precision)

The maximum total number of decimal digits that will be
stored, both to the left and to the right of the decimal point.

The
precision must be a value from 1 through the maximum precision of 38.
The default precision is 18.

s (scale)

The number of decimal digits that will be stored to the right of the decimal point.

This number is subtracted from p
to determine the maximum number of digits to the left of the decimal
point.

The maximum number of decimal digits that can be stored to the
right of the decimal point.

Scale must be a value from 0 through p.

Scale can be specified only if precision is specified.

The default scale is 0; therefore, 0 <= s <= p.

Maximum storage sizes vary, based on the precision.

Example

numeric(18,2)的取值范围

最大9999999999999999.99  小数点右边两位数字,左边16位数字

numeric and int in sql server的更多相关文章

  1. sql server中常用方法函数

    SQL SERVER常用函数 1.DATEADD在向指定日期加上一段时间的基础上,返回新的 datetime 值. (1)语法: DATEADD ( datepart , number, date ) ...

  2. 五、Sql Server 基础培训《进度5-数据类型(知识点+实际操作)》

    知识点: ================================================= ============================================= ...

  3. SQL Server 获取服务器信息

    最近做了一个小工具,里面涉及到一些取SQL Server 服务器信息的一些东西,找了好久,找到一个不错的,贴出来分享. 系统函数 SERVERPROPERTY ( propertyname ) 包含要 ...

  4. SQL Server中临时表是在什么schema下的(转载)

    Specifying schema for temporary tables 问: I'm used to seeing temporary tables created with just the ...

  5. 手工注入——sql server (mssql)注入实战和分析

    前言 首先要对sql server进行初步的了解.常用的全部变量@@version:返回当前的Sql server安装的版本.处理器体系结构.生成日期和操作系统.@@servername:放回运行Sq ...

  6. sql server数据库中 smallint, int ,bigint ,tinyint的区别与长度

    smallint  是一种精确的数值数据类型,其精度在算术运算后不变,采用2个字节编码 有符号的 smallint 值的范围是 -2^15-------2^15 -1,即 -32768 ----327 ...

  7. SQL server数据类型int、bigint、smallint、tinyint

    1. 整数类型 int.bigint.smallint.tinyint 数据类型 范围 存储 bigint -2^63 (-9,223,372,036,854,775,808) 到 2^63-1 (9 ...

  8. SQL Server数据类型int、bigint、smallint、tinyint对比表

    SQL Server数据类型int.bigint.smallint.tinyint对比表 数据类型 范围 存储 bigint -2^63 (-9,223,372,036,854,775,808) 到 ...

  9. sql server like 在将值转换成数据类型int失败

    select * from table where title like '%'?'%'; 采用? 传参会报错:sql server like 在将值转换成数据类型int失败 select * fro ...

随机推荐

  1. Ubuntu 15.10 安装Qt5.5.1

    本系列文章由 @YhL_Leo 出品,转载请注明出处. 文章链接: http://blog.csdn.net/yhl_leo/article/details/50300447 本人使用的ubuntu系 ...

  2. Java 获取环境变量

    Java 获取环境变量Java 获取环境变量的方式很简单: System.getEnv()  得到所有的环境变量System.getEnv(key) 得到某个环境变量的值 由于某些需要,可能要下载某些 ...

  3. codeforces7D Palindrome Degree(manacher&amp;dp或Hsh&amp;dp)

    D. Palindrome Degree time limit per test 1 second memory limit per test 256 megabytes input standard ...

  4. python-Pymyslql-requests_html:把腾讯新闻的今日推荐和链接存进数据库

    使用pumsql封装的部分功能 request_html:打开www.qq.com的例子 结果: PS:记得处理数据

  5. centos6高速部署java应用

    眼下提供IDC服务的厂商真的是五花八门,可是更正服务到位的却为数不多,搞得比較好的应该是阿里云.天成.51idc,出于时间考虑还是建议选用windows,至少安装开发环境会方便得多,不会耗费太长时间. ...

  6. JavaScript语法高亮库highlight.js使用

    highlight.js是一款基于JavaScript的语法高亮库,目前支持125种编程语言,有63种可供选择的样式,而且能够做到语言自动识别,和目前主流的JS框架都能兼容,可以混合使用. 这款高亮库 ...

  7. 51nod 1307 绳子与重物 (标记父节点更新即可)

    1307 绳子与重物 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 有N条绳子编号 0 至 N - 1,每条绳子后面栓了一个重物重量为Wi,绳子的最大负重为Ci. ...

  8. 新疆大学OJ(ACM) 1047: string 字符串排序

    1047: string 时间限制: 1 Sec  内存限制: 128 MB 题目描述 有n个字符串字符串n<=50000,把所有字符串串起来,得到一个字典序最小的字符串. 输入 输入第一行是一 ...

  9. Linux rm删除大批量文件遇到 Argument list too long

    在使用rm删除大批量文件时,有可能会遭遇“参数列太长”(Argument list too long)的问题.如下所示   [oracle@DB-Server bdump]$ rm -v epps_q ...

  10. ActiveMQ学习笔记(14)----Destination高级特性(二)

    1. Visual Destinations 1.1 概述 虚拟Destination用来创建逻辑Destinations,客户端可以通过它来产生和消费消息,它会把消息映射到物理Destination ...