Is there any editable Auto-Increment besdies IDENTITY?

The reason I need this for is that I made a column on my table called display_order, for now it's smallint and the numbers were pre-determined.

However, when I insert a new record with my software I don't know how to get the highest number in that column and add 1, so I thought about the possibility of an auto-incremented column where if I change 8 to 9 it will change everything else accordingly.

Is this possible?
Who is Participating?
Christopher GordonSenior Developer AnalystCommented:

I usually return that value via the link or putting select @@identity at the bottom of my insert statement.  What kind of software are you using to call the insert?  Does it have a way to grab that return SCOPE_IDENTITY and set that value to a variable?
John86aAuthor Commented:
It's a custom one that I'm programming
Anthony PerkinsCommented:
All you have to do is define the column as having the IDENTITY attribute.
sounds more like you are wanting a trigger to handle the reordering...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.