6
For Identity
do not want, because it breaks the sequence if something happens. Max() + 1
, I find it very vulnerable and slow when you have a lot of records. So I ask you, is there a way that someone knows, that I can generate sequential numbers and if there’s a problem in generation, it doesn’t fire the number, like Identity does? They say that there are algorithms that do this in Sql Server, but would not like to use triggers. Usage Sql Server 2008
, Entity 6
and C#
. Will be generated by C#
with Entity
.
use sequences + transactions with Isolation level up there (which generates performance impact due to "queuing") would not solve for you?
– Marcelo Bezerra bovino
The most common and indicated is the use of Sequence in SQL Server, more if you call Next and do not use you lose the number, for this I think you would have to deal with in C#, maybe.
– Fernando Leal
Sequence only exists from SQL Server 2012, the question is in 2008.
– dang
Why you need sequential numbers that
identities
would not be able to provide?– Oralista de Sistemas
Are you uniquely in need of a sequel? If not, the @Ciganomorrisonmendex response is quite helpful.
– brazilianldsjaguar
@pnet you are stuck to SQL Server 2008 or an upgrade is possible?
– gmsantos