Unlike in Oracle, sqlserver has an special data type in order by make identity growth. But what about if the number is exceed or approaching the limited ?

Yes. there will show an error like :

Arithmetic overflow error converting IDENTITY to data type int. Arithmetic overflow occurred.

In fact, we could monitor in any time..

Script:

select a.TABLE_NAME,a.COLUMN_NAME,a.DATA_TYPE,
(CASE a.DATA_TYPE when 'int' then 'limited between -2147483648 and 2147483647'
when 'bigint' then 'limited between -9223372036854775808 and 9223372036854775807'
when 'smallint' then 'limited between -32768 and 3767'
when 'decimal' then 'limited between -10^38 and 10^38 - 1'
END
) as "Description",
c.INCREMENT_VALUE,
c.LAST_VALUE as "current identity",
' ',
(CASE a.DATA_TYPE when 'int' then 2147483647
when 'bigint' then 9223372036854775807
when 'smallint' then 3767
when 'decimal' then 9999999999999999999999999999999
END
) as "MAX value"
from INFORMATION_SCHEMA.COLUMNS a inner join
SYS.objects b on a.TABLE_NAME=b.name
inner join SYS.IDENTITY_COLUMNS c on b.object_id=c.object_id
where COLUMNPROPERTY(object_id(a.TABLE_SCHEMA+'.'+a.TABLE_NAME), a.COLUMN_NAME, 'IsIdentity') = 1
and a.COLUMN_NAME=c.name and a.table_name=OBJECT_NAME(c.OBJECT_ID)
order by a.TABLE_NAME

You could see like this following result.

How to check sqlsever table data type identity status ?的更多相关文章

  1. XML Data Type Methods(一)

    XML Data Type Methods(一) /*XML Data Type Methods: 1.The query('XQuery') method retrieves(vt.检索,重新得到) ...

  2. Extended Data Type Properties [AX 2012]

    Extended Data Type Properties [AX 2012] This topic has not yet been rated - Rate this topic Updated: ...

  3. SQL Server error "Xml data type is not supported in distributed queries" and workaround for it

    Recently while working with data migration,got an error while running a following query where Server ...

  4. [TI DLP Buglist]data type error in illum_EnableIllumination function

    I am debuging my code today, I find when my code is running, it's stop at illum_EnableIllumination() ...

  5. vue bug & data type bug

    vue bug & data type bug [Vue warn]: Invalid prop: type check failed for prop "value". ...

  6. MySql and Oracle Data Type Mappings

    the default settings used by SQL Developer to convert data types from MySQL to Oracle. SQL Developer ...

  7. windows7下解决caffe check failed registry.count(type) == 1(0 vs. 1) unknown layer type问题

    在Windows7下调用vs2013生成的Caffe静态库时经常会提示Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer t ...

  8. Entity Framework Tutorial Basics(33):Spatial Data type support in Entity Framework 5.0

    Spatial Data type support in Entity Framework 5.0 MS SQL Server 2008 introduced two spatial data typ ...

  9. Inheritance with EF Code First: Part 2 – Table per Type (TPT)

    In the previous blog post you saw that there are three different approaches to representing an inher ...

随机推荐

  1. JWT实现授权认证

    目录 一. JWT是什么 二. JWT标准规范 三. 核心代码简析 四. 登录授权示例 五. JWT 使用方式 六. JWT注意事项 一. JWT是什么 JSON Web Token(JWT)是目前最 ...

  2. vue不常用到的v-model修饰符

    v-model的input事件同步输入框的数据根据输入的内容实时改变.v-model.lazy则是与change事件同步,即失去焦点或是回车才更新 v-model.number 将输入的数字转换为Nu ...

  3. 【转】基于ArcGIS for javascript api 轨迹回放

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/stri ...

  4. 一步一步教你PowerBI利用爬虫获取天气数据分析

    对于爬虫大家应该不会陌生,我们首先来看一下爬虫的定义:网络爬虫是一种自动获取网页内容的程序,是搜索引擎的重要组成部分.网络爬虫为搜索引擎从万维网下载网页,自动获取网页内容的应用程序.看到定义我们应该已 ...

  5. Elasticsearch系列---实战零停机重建索引

    前言 我们使用Elasticsearch索引文档时,最理想的情况是文档JSON结构是确定的,数据源源不断地灌进来即可,但实际情况中,没人能够阻拦需求的变更,在项目的某个版本,可能会对原有的文档结构造成 ...

  6. windows服务搭建(VS2019创建Windows服务不显示安装组件)

    1.创建windows服务应用 2.右键查看代码 3.写个计时器Timer  using System.Timers; 如上图,按tab键快速操作  会自动创建一个委托 改为下边的方式,打印日志来记录 ...

  7. 曹工说Spring Boot源码(11)-- context:component-scan,你真的会用吗(这次来说说它的奇技淫巧)

    写在前面的话 相关背景及资源: 曹工说Spring Boot源码(1)-- Bean Definition到底是什么,附spring思维导图分享 曹工说Spring Boot源码(2)-- Bean ...

  8. 「扫盲」Elasticsearch

    前言 只有光头才能变强. 文本已收录至我的GitHub精选文章,欢迎Star:https://github.com/ZhongFuCheng3y/3y 不知道大家的公司用Elasticsearch多不 ...

  9. 6.反编译 java---class (字节码文件)---反编译(IDEA):

  10. 「 Android开发 」开启第一个App应用

    每天进步一丢丢,连接梦与想 无论什么时候,永远不要以为自己知道一切   -巴普洛夫 最近玩了下Android,但遇到了一些坑,浪费了很多的时间,在此记录一下,你若是遇到了就知道怎么解决了 PS:建议使 ...