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
 SQL Server Development (2000)
 finding out the next key

Author  Topic 

CLages
Posting Yak Master

116 Posts

Posted - 2005-04-16 : 08:06:50
hi, its me again
i have a table like this

id etc..

1
33
38
69
99

id is a Key
99 is the last key (table can have only 99 records

How can find out the next available key ? (anyone)
in this case could be (2,3,..56, 98)

ps. I can Not use Max(id)+ 1 because in this case
i will get 100


tks
CLages


spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-04-16 : 08:10:30
will this be of any help?
http://www.nigelrivett.net/SQLTsql/FindGapsInSequence.html

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -