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.
| Author |
Topic |
|
kiranmayi
Starting Member
4 Posts |
Posted - 2009-08-06 : 09:55:23
|
| hiiam using sqlserver 2005in my table i have id,name,location fields.id is autoincrement columnfor example id name location 1 abc hyd 2 xyz gun 3 pqr vizif i delete second record and then i insert new record the data is like this 1 abc hyd 3 pqr viz 4 kkm banbut i want like this 1 abc hyd2 pqr viz3 kkm banhow can we do? |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-08-06 : 09:56:16
|
| Why does gap matter?MadhivananFailing to plan is Planning to fail |
 |
|
|
johnconstraint
Starting Member
23 Posts |
Posted - 2009-08-06 : 10:23:39
|
| This is exactly the expected behaviour of SQL server....the autoincrement column will keep increasing the numbers, will never asign the numbers that are deleted to new records inserted.... |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-08-06 : 10:24:03
|
you can always use row_number() to generate a continuous running number KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|