当前位置: 代码迷 >> Sybase >> sybase的truncate不能重置identity的种子计数解决方案
  详细解决方案

sybase的truncate不能重置identity的种子计数解决方案

热度:7727   发布时间:2013-02-26 00:00:00.0
sybase的truncate不能重置identity的种子计数
不知道为什么
大家都说truncate table 可以重置identity字段的种子数
但是为什么sybase不行的
我用的是
12.5.3版本


------解决方案--------------------------------------------------------
不管用什么版本,truncate table 都不可以重置identity字段的值。
但可以用一下方法:
1、set identity_insert <table> on
2、显式增加一条记录(指定identity字段值)
3、set identity_insert <table> off
就可以了。
  相关解决方案