类型映射

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. SQL SERVER-安装和卸载

    卸载后无法正常安装SQL SERVER 删除了本机的SQL SERVER以后,我发现我本机的SQL SERVER 再也安装不上了,这个一个比较严重的问题,要每天定时备份数据库到指定的地方才能防止数据丢 ...

  2. BZOJ——1602: [Usaco2008 Oct]牧场行走 || 洛谷—— P2912 [USACO08OCT]牧场散步Pasture Walking

    http://www.lydsy.com/JudgeOnline/problem.php?id=1602 || https://www.luogu.org/problem/show?pid=2912 ...

  3. ORACLE-014:oracle中查看DBLinkpassword

    dblink在数据库中使用是比較多的,简单方便.只是随着oracle安全机制的加强.普通用户登录仅仅能看到,username以及连接字符串.那么dblinkpassword怎样查看呢? 非常easy. ...

  4. Unsupported major.minor version 51.0问题的解决

    在java编程的过程中,当用myeclipse软件打开别人写的代码时,遇到Unsupported major.minor version 51.0此类问题,实在是令人痛苦不堪.弄了整整一晚才搞清楚,我 ...

  5. C++ STL 源代码学习(之deque篇)

    stl_deque.h /** Class invariants: * For any nonsingular iterator i: * i.node is the address of an el ...

  6. 在vmware下为oracle RAC 创建共享存储的总结

    首先,介绍下用命令行vm-diskmanager形式创建磁盘文件的方法(其实,图形界面添加新磁盘就是调用此命令).       很多网上文章提及plainmaker.exe去创建共享磁盘,是以前的版本 ...

  7. luogu 1351 联合权值

    联合权值 题目大意 给你一个图,有\(n-1\)条边,距离均为\(1\),每距离为\(2\)的两个点的联合权值为\(W_u \times W_v\),求联合权值的最大值和联合权值总和. solutio ...

  8. SqlDependency C#代码监听数据库表的变化

    SqlDependency提供了这样一种能力:当被监测的数据库中的数据发生变化时,SqlDependency会自动触发OnChange事件来通知应用程序,从而达到让系统自动更新数据(或缓存)的目的. ...

  9. Windows上快速编译caffe CPU版本

    windows上快速安装配置Caffe的 cpu_only环境. 一:安装环境: 1.windows10: 2.Visual Studio2013: 3.Caffe版本:http://github.c ...

  10. 函数签名与消息转发:NSInvocation与NSMethodSignature

    具体可见 https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Article ...