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 ...
随机推荐
- mybatis和hibernate的区别【转】
第一章 Hibernate与MyBatisHibernate 是当前最流行的O/R mapping框架,它出身于sf.net,现在已经成为Jboss的一部分. Mybatis 是另外一种优秀的 ...
- 扩展MARA 加入Z字段BAPI_TE_MARA
1. 在MARA中APPEND新的结构 2.在BAPI_TE_MARA中APPEND新的结构 (可是这里不能有QUAN,CURR,DEC等数据类型) 3.在BAPI_TE_MARAX中APPEND新的 ...
- web security
brute force cracking 暴力破解 Brute force (also known as brute force cracking) is a trial and error me ...
- 仿写从iOS8开始支持的UIAlertController:BGAAlertController-Android
工作以来公司UI设计师出的Android效果图都是iOS风格的UIAlertView和UIActionSheet,新项目还是用原来那一套,不想重复造轮子,所以仿写了从iOS8开始支持的UIAlertC ...
- sql-查看执行计划的方法
sql执行计划:把SQL语句拆分为每个的操作步骤组合,按照一定的顺序执行得出结果,查看并看懂执行计划是调优的关键步骤 查看执行计划的方法 DBMS_XPLAN包 sql*plus AUTO trace ...
- CSS3的常用属性(一)
选择器 属性选择器(通过标签属性来选择) E[attr]: 表示只要元素<E>存在属性attr就能被选中 如: div[class] E[attr=val]: 表示元素<E> ...
- 学习es6 setter/getter研究
1.背景 在ES6中,我们对类的定义如下 class Person { // 构造函数 constructor (name) { // 属性初始化 this.name = name; } // 成员方 ...
- 【算法】单源最短路径和任意两点最短路径总结(补增:SPFA)
[Bellman-Ford算法] [算法]Bellman-Ford算法(单源最短路径问题)(判断负圈) 结构: #define MAX_V 10000 #define MAX_E 50000 int ...
- Hibernate框架学习(一)——入门
一.框架是什么 1.框架是用来提高开发效率的 2.封装好了一些功能,我们需要使用这些功能时,调用即可,不需要手动实现 3.框架可以理解成一个半成品的项目,只要懂得如何驾驭这些功能即可 二.hibern ...
- GatewayWorker 版本升级过程和注意点
公司开发用到WorkerMan框架,开发RPC服务,用于拉取用户信息和协助用户注册. workman 官网:http://www.workerman.net/workerman 老版本: worker ...