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 ...
随机推荐
- Spring IoC容器实现
1,Spring的两种IoC容器 BeanFactory 基础类型的IoC容器: 采用延迟初始化策略(容器初始化完成后并不会创建bean的对象,只有当收到初始化请求时才进行初始化): 由于延迟初始化, ...
- HDU 4035
dp求期望的题. 设 E[i]表示在结点i处,要走出迷宫所要走的边数的期望.E[1]即为所求. 叶子结点: E[i] = ki*E[1] + ei*0 + (1-ki-ei)*(E[father[i] ...
- Aizu - 2305 Beautiful Currency (二分 + DFS遍历)
F. Beautiful Currency Time Limit: 5000ms Case Time Limit: 5000ms Memory Limit: 65536KB 64-bit intege ...
- Math类概述及其成员方法
Math 类包括用于运行基本数学运算的方法,如初等指数.对数.平方根和三角函数,这个类寻常开发中用的不多,可是在某些需求上会用到,比方求二个用户年龄的相差多少岁,这会用到Math类中的方法!如今把Ma ...
- @dynamic与@synthesize的差别
如今非常多时候我们都已经不再使用@synthesizekeyword了,可是须要了解当中的原理: 一.@dynamic与@synthesize的差别 @property有两个相应的词.一个是@synt ...
- [JZOJ NOIP2018模拟10.20 A组]
由于T3数据出锅,还不清楚自己的分数...估分150,前100已经拿到了,T3的50没拍过(写的就是暴力怎么拍),感觉很不稳 考试的时候就是特别的困,大概是因为早上在房间里腐败...腐败完了才睡觉 T ...
- Ubuntu16.04+OpenCV3.2.0+Opencv_Contrib3.2.0安装
为了学习slam,在ubuntu16.04系统上安装opencv3.2.0以及对应的opencv_contrib3.2.0 安装过程 下载 Github上下载有的时候比较慢,我这里分享了OpenCV3 ...
- 基于Asp.Net webApi owin oauth2的实现
干货地址:https://git.oschina.net/DpMa_/WebApi-Owin-oauth2
- python网页问题
#django-admin不是个命令 添加环境变量 D:\Python36\Scripts #localhost加载失败 命令行 python manage.py runserver 0.0.0.0: ...
- (转载)你真的理解Android AIDL中的in,out,inout么?
前言 这其实是一个很小的知识点,大部分人在使用AIDL的过程中也基本没有因为这个出现过错误,正因为它小,所以在大部分的网上关于AIDL的文章中,它都被忽视了——或者并没有,但所占篇幅甚小,且基本上都是 ...