SET IDENTITY_INSERT (Transact-SQL)

Allows explicit values to be inserted into the identity column of a table.

Remarks

At any time, only one table in a session can have the IDENTITY_INSERT property set to ON. If a table already has this property set to ON, and a SET IDENTITY_INSERT ON statement is issued for another table, SQL Server returns an error message that states SET IDENTITY_INSERT is already ON and reports the table it is set ON for.

If the value inserted is larger than the current identity value for the table, SQL Server automatically uses the new inserted value as the current identity value.

The setting of SET IDENTITY_INSERT is set at execute or run time and not at parse time.

DBCC CHECKIDENT (Transact-SQL)

Checks the current identity value for the specified table in SQL Server 2017 and, if it is needed, changes the identity value.

You can also use DBCC CHECKIDENT to manually set a new current identity value for the identity column.

可以使用这个功能进行reseed,也可以用来检查current identify value

最新文章

  1. Kotlin的android扩展:对findViewById说再见(KAD 04)
  2. HTML基础(3)
  3. time模块目录下自己建立一个名为log的文件夹
  4. The entity type <type> is not part of the model for the current context
  5. a2x
  6. Android:使用ViewPager实现左右滑动切换图片(图上有点点)
  7. Bootstrap 基础教程
  8. 在iOS上present一个半透明的viewController
  9. ARM LDR伪指令使用方法具体解释
  10. Map接口的学习
  11. Java-WebSocket 项目的研究(三) WebSocketClient 类 具体解释
  12. Android Framework 学习和需要学习的内容
  13. ply python 图片压缩 图片裁剪 旋转
  14. angular.isDate()
  15. Hibernate-day04
  16. BZOJ5294 BJOI2018 二进制 线段树
  17. 【转】Windows Server 2008 R2下安装 .net framework3.5
  18. Angular2入门:TypeScript的函数 - 函数定义、可选参数、默认参数和函数重载
  19. IDEA学生免费申请教程
  20. vs感受,由于我的电脑装了俩年了!我直接写感受吧

热门文章

  1. msp430项目编程35
  2. yii 之增加数据
  3. OC-为何用copy修饰block
  4. mysql主从库
  5. spring解决乱码
  6. 洛谷 P3865 【模板】ST表
  7. Spring注入内部的Beans
  8. haproxy和nginx负载均衡分析
  9. ftp服务器调用出错
  10. JS创建对象几种不同方法具体解释