类型映射

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. POJ 3744

    矩阵快速乘求概率,不难.但有注意的一点是,一定要注意地雷连着的情况,一旦出现两个雷相邻,就必定为0了. #include <iostream> #include <algorithm ...

  2. 【转载】linux下的usb抓包方法

    1 linux下的usb抓包方法 1.配置内核使能usb monitor: make menuconfig                   Device Drivers -->        ...

  3. poj1961--Period(KMP求最小循环节)

    Period Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 13511   Accepted: 6368 Descripti ...

  4. fancybox关闭弹出窗体parent.$.fancybox.close();

    fancybox弹出窗体右上角会自带一个关闭窗体,而且点击遮罩层也会关闭fancybox 有时我们不须要这样进行关闭,隐藏关闭窗体,而且遮罩层不可点击 在弹出窗体页面加一链接进行关闭使用parent. ...

  5. JStorm之Topology调度

      topology在服务端提交过程中,会经过一系列的验证和初始化:TP结构校验.创建本地文件夹并拷贝序列化文件jar包.生成znode用于存放TP和task等信息,最后一步才进行任务分配.例如以下图 ...

  6. php在数字前面补0得到固定长度数字的两种方法

    比較基础,事实上两个内置函数都能实现. 1  sprintf 语法: string sprintf(string format, mixed [args]...); 返回值: 字符串 函数种类: 资料 ...

  7. ffmpeg在android上输出滑屏问题处理

    ffmpeg部分机器上有花屏的问题 原代码例如以下: while(av_read_frame(formatCtx, &packet)>=0 && !_stop & ...

  8. JAVA配置Tomcat

    1.下载tomcat,我jdk是1.8的,网上查了一下,说要安装tomcat8及以上的tomcat 尝试点击,弹出, 2.配置环境 3.安装通过cmd安装 4.点击开启服务 5.输入localhost ...

  9. [JZOJ 5905] [NOIP2018模拟10.15] 黑暗之魂(darksoul) 解题报告 (拓扑排序+单调队列+无向图基环树)

    题目链接: http://172.16.0.132/senior/#main/show/5905 题目: oi_juruo热爱一款名叫黑暗之魂的游戏.在这个游戏中玩家要操纵一名有 点生命值的无火的余灰 ...

  10. xBIM 基础16 IFC的空间层次结构

    系列目录    [已更新最新开发文章,点击查看详细]  本篇介绍如何从文件中检索空间结构.IFC中的空间结构表示层次结构的嵌套结构,表示项目,站点,建筑物,楼层和空间.如果您查看IFC文档, 您会发现 ...