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)
 Return counter number without skipping

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-05 : 09:34:02
Quan writes "Hello,

Is it possible to return a sequence number without skipping a number? For example, if the user request a document number range from 300,000 to 900,000. That is 600,000 available numbers to use. If first user request a document number, he/she get 300,000 in a transaction. If second user request a document number he/she get 300,001. However, if there's an error in the transaction of the first user, a third user should get 300,000 as his/her document number. How do I create a table and write a stored procedure that is capable of doing this? Thank you.

Quan"
   

- Advertisement -