Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Identity Column

Author  Topic 

purisqlserver
Yak Posting Veteran

73 Posts

Posted - 2002-05-10 : 04:16:40
Hi,

I have set up a Identity column in orders table. The number is not generated in sequence, sometimes the number jumps,creating a gap.
Ex- 1001 to 1005, thus 1002,1003,1004,being left out. This has happened 3times of late.
What can be reason,how can it be solved???????
Sql Server 2000 is used.
Thanx,

rihardh
Constraint Violating Yak Guru

307 Posts

Posted - 2002-05-10 : 04:29:31
The gap is normal thing in identity columns. I assume that users can also delete orders (rows) in your orders table. If not you should check your front end, how and when does a row get inserted (ADO?). If you are using the values in this column as order numbers, I suggest that you add a second column and manualy set the order number for each record (row) using a trigger (for example an insert trigger).

Have fun!

BOL is for reading.

Go to Top of Page
   

- Advertisement -