January 6, 2011 at 4:02 am
I have a table in which 1 identity column means auto increment of 1.If i delete 1 or more than 1 rows in a table,then it should be reformatting.For example,Like 10 rows in a table,if we delete 3rd rows then the identity column will be managed from 1 to 9 serially.
Col1 col2
1 A
2 B
3 C
4 D
5 E
After deleting 3 rows:
Col1 col2
1 A
2 B
3 D
4 E
January 6, 2011 at 4:17 am
That's not how auto-incrementing works.
Usually, auto-incrementing is used to create a unique number to refernce that in another table. If you renumber your values, you'd change the references.
Why do you need to have it numbered without gaps?
Anyhow, you could renumber Col1 using ROW_NUMBER()...
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply