numeric and int in sql server
类型映射
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的更多相关文章
- sql server中常用方法函数
SQL SERVER常用函数 1.DATEADD在向指定日期加上一段时间的基础上,返回新的 datetime 值. (1)语法: DATEADD ( datepart , number, date ) ...
- 五、Sql Server 基础培训《进度5-数据类型(知识点+实际操作)》
知识点: ================================================= ============================================= ...
- SQL Server 获取服务器信息
最近做了一个小工具,里面涉及到一些取SQL Server 服务器信息的一些东西,找了好久,找到一个不错的,贴出来分享. 系统函数 SERVERPROPERTY ( propertyname ) 包含要 ...
- SQL Server中临时表是在什么schema下的(转载)
Specifying schema for temporary tables 问: I'm used to seeing temporary tables created with just the ...
- 手工注入——sql server (mssql)注入实战和分析
前言 首先要对sql server进行初步的了解.常用的全部变量@@version:返回当前的Sql server安装的版本.处理器体系结构.生成日期和操作系统.@@servername:放回运行Sq ...
- sql server数据库中 smallint, int ,bigint ,tinyint的区别与长度
smallint 是一种精确的数值数据类型,其精度在算术运算后不变,采用2个字节编码 有符号的 smallint 值的范围是 -2^15-------2^15 -1,即 -32768 ----327 ...
- 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 ...
- SQL Server数据类型int、bigint、smallint、tinyint对比表
SQL Server数据类型int.bigint.smallint.tinyint对比表 数据类型 范围 存储 bigint -2^63 (-9,223,372,036,854,775,808) 到 ...
- sql server like 在将值转换成数据类型int失败
select * from table where title like '%'?'%'; 采用? 传参会报错:sql server like 在将值转换成数据类型int失败 select * fro ...
随机推荐
- java源码之HashSet
1,HashSet介绍 1)HashSet 是一个没有重复元素的集合.2)它是由HashMap实现的,不保证元素的顺序,而且HashSet允许使用 null 元素.3)HashSet是非同步的.如果多 ...
- 在JAVA中将class文件编译成jar文件包,运行提示没有主清单属性
在JAVA中将class文件编译成jar文件包,运行提示没有主清单属性 Maven 项目生成jar运行时提示“没有主清单属性” 新建了一个Maven的项目,mvn compile和mvn packag ...
- CentOS6.3升级GCC到GCC4.8.2
server上安装的GCC版本号过旧.已经不满足个人使用的版本号需求,故决定对其进行升级操作.由当前版本号3.4.6升级到4.8.2.然受权限制约.仅仅能安装到个人文件夹.因此假设您的server能够 ...
- myeclipse配置内存
1.javaee项目假设耗费的内存过大,须要配置内存大小: 下图是配置tomcat结果:Optional program arguments: -Xms512M -Xmx512M -XX:PermSi ...
- HDU 5296 Annoying problem dfs序 lca set
Annoying problem Problem Description Coco has a tree, whose nodes are conveniently labeled by 1,2,…, ...
- Testbench代码设计技巧
Testbench代码设计技巧 " There are many ways " to code a test case, it all depens on the creativi ...
- JAVA设计模式之【代理模式】
代理模式 通过代理对象间接访问 代购 客户端不想或者不能直接访问一个对象,可以通过一个称为代理的第三者来实现间接访问,该方案称为代理模式 角色 抽象主题角色Subject 声明真实主题类与代理类的公共 ...
- ORA-01261: Parameter db_recovery_file_dest destination string cannot be translat
查看了Oracle的初始化文件. $cat /oracle/oms/102_64/dbs/initSID.ora 如:db_recovery_file_dest='/oracle/oms/flash_ ...
- What's new in Safari 11.0
导语: Safari 11.0 的亮点 网络会议.使用WebRTC标准实现对等会议. 开发调试工具增强.使用用于测量代码和网络性能的新工具来测试代码. WebAssembly.当使用新的WebAsse ...
- HDU 3584 Cube 【 三维树状数组 】
题意:还是那篇论文里面讲到的,三维树状数组http://wenku.baidu.com/view/1e51750abb68a98271fefaa8画个立方体出来对照一下好想一点 #include< ...