SQL Server 2005身份本身增加 [英] SQL Server 2005 identity incrementing by itself

查看:71
本文介绍了SQL Server 2005身份本身增加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有标识列的表,该表的所有记录都增加了1,然后上周突然开始以一种怪异的方式增加了.
例如:

I have a table with an identity column that have incremented by 1 for all its records then suddenly last week it started incrementing in a weird way.
For example:

身份-日期

31891 2010-02-27 09:47:41    
39258 2010-02-27 13:13:03    
41994 2010-02-27 13:43:56   
45119 2010-02-27 14:44:43    
45120 2010-02-27 14:51:33
45121 2010-02-27 15:01:12    
63943 2010-02-27 19:38:24    
63944 2010-02-27 20:14:11   
73344 2010-02-27 22:06:35   
78298 2010-02-27 22:54:43    
124007 2010-02-28 07:02:51    
130482 2010-02-28 07:35:34    
130483 2010-02-28 08:05:02    
144470 2010-02-28 10:11:57    
164253 2010-02-28 11:30:00   
254921 2010-02-28 16:59:51    
254922 2010-02-28 17:06:28

如果您查看时间,则可以看到插入之间的时间越长,增量越高.我完全不知道为什么会这样.我不在表上执行任何删除查询,因此无法删除行.

If you look at the time you can see that the longer time it is between inserts the highter the increment is. I am totally lost to why this is happening. I do not perform any delete queries on the table so it can't be deleted rows.

推荐答案

每次尝试插入时,标识序列都会递增-包括失败或回滚的INSERT.您是否有任何产生插入错误或回滚的过程?

An identity sequence is incremented any time an insert is attempted -- this includes a failed or rolled back INSERT. Do you have any processes generating insert errors or rolling back?

这篇关于SQL Server 2005身份本身增加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆