-6

I upgraded my SQL Server 2008 R2 to SQL Server 2012, and I had noticed a new feature was added: Sequence.

I don't know the reason of adding sequences when there is an identity property.

Can someone elaborate on what this feature is useful for?

6

Some examples

A sequence:

  • allows you know the new number before you actually write to the table
    Example: how to get the IDENTITY value in a BEFORE TRIGGER
  • one sequence can be used for more then one table
    A.k.a get a value that will be unique across many tables without supertype/subtype
| improve this answer | |
-2

Can someone elaborate on what this feature is useful for?

Generating sequences, is that not obvious?

Stuff like account numbers, order numbers, order numbers - that may not even be used as identity as in identity column.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.