O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

SEQUENCE Objects Versus Identity Columns

Identity columns and SEQUENCE objects are similar in that both are methods you can use to generate sequential numbers. The main difference is that Identity columns are part of the table definition, and you can only have one Identity column per table. SEQUENCE objects are independent database objects, and the sequence numbers generated can be used for any table or column.

You may want to consider using SEQUENCE objects instead of Identity columns under the following scenarios:

Image You need to know the sequence value before inserting into the table.

You want to share a series of sequence numbers between multiple ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required