-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?

closed as not a real question by Marian, gbn, Paul White, Mark Storey-Smith, RolandoMySQLDBA Jun 11 '13 at 12:04

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

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
-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.

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