I've previously talked about the sequence object:
But I'ld like to call your attention to what happens when generating numbers inside a transaction.
As mencioned, in the blog, we can generate next number by just running statement select. And, what happens if I insert that select inside a transaction, as shown below:
SELECT NEXT VALUE FOR dbo.Seq
This means that inspite transaction being rolled back or not, once you call the object to generate a new value, this will be permanent. This is because sequence numbers are generated outside the scope of the transaction and they are generated wether the transaction is committed or rolled back.