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 |
|
sparrow37
Posting Yak Master
148 Posts |
Posted - 2010-03-27 : 02:04:42
|
| Hi all,I have created a table with identity column. When I insert a new value in table, it inserts a new row and next value in identity column. If i delete a row, it adds value next to maximum value and there is always a gap like this in identity column( 1,2,3,4,9,10). Can I set some property in sql server so that if some row is deleted and new row is inserted it should take place of that identity column.Regards,Asif Hameed |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-27 : 02:17:20
|
| nope.. there's no direct way to do this unless you write a proc to reclaim lost values. But to be honest you shouldnt be worried at gaps as you can always retrieve records in correct order even with gaps or if you want to generate sequential value, you can do it on the fly using window functions like ROW_NUMBER------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|