Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7762453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:24:25+00:00 2026-06-01T14:24:25+00:00

SQL Server 2012 introduced Sequence as a new feature, same as in Oracle and

  • 0

SQL Server 2012 introduced Sequence as a new feature, same as in Oracle and Postgres. Where sequences are preferred over identities? And why do we need sequences?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:24:28+00:00Added an answer on June 1, 2026 at 2:24 pm

    I think you will find your answer here

    Using the identity attribute for a column, you can easily generate
    auto-incrementing numbers (which as often used as a primary key). With
    Sequence, it will be a different object which you can attach to a
    table column while inserting. Unlike identity, the next number for the
    column value will be retrieved from memory rather than from the disk –
    this makes Sequence significantly faster than Identity. We will see
    this in coming examples.

    And here:

    Sequences: Sequences have been requested by the SQL Server community
    for years, and it’s included in this release. Sequence is a user
    defined object that generates a sequence of a number. Here is an
    example using Sequence.

    and here as well:

    A SQL Server sequence object generates sequence of numbers just like
    an identity column in sql tables. But the advantage of sequence
    numbers is the sequence number object is not limited with single sql
    table.

    and on msdn you can also read more about usage and why we need it (here):

    A sequence is a user-defined schema-bound object that generates a
    sequence of numeric values according to the specification with which
    the sequence was created. The sequence of numeric values is generated
    in an ascending or descending order at a defined interval and may
    cycle (repeat) as requested. Sequences, unlike identity columns, are
    not associated with tables. An application refers to a sequence object
    to receive its next value. The relationship between sequences and
    tables is controlled by the application. User applications can
    reference a sequence object and coordinate the values keys across
    multiple rows and tables.

    A sequence is created independently of the tables by using the CREATE
    SEQUENCE statement. Options enable you to control the increment,
    maximum and minimum values, starting point, automatic restarting
    capability, and caching to improve performance. For information about
    the options, see CREATE SEQUENCE.

    Unlike identity column values, which are generated when rows are
    inserted, an application can obtain the next sequence number before
    inserting the row by calling the NEXT VALUE FOR function. The sequence
    number is allocated when NEXT VALUE FOR is called even if the number
    is never inserted into a table. The NEXT VALUE FOR function can be
    used as the default value for a column in a table definition. Use
    sp_sequence_get_range to get a range of multiple sequence numbers at
    once.

    A sequence can be defined as any integer data type. If the data type
    is not specified, a sequence defaults to bigint.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In SQL Server 2012 (Denali), we have a new feature Sequence . Consider the
I installed VS 11 beta and SQL Server 2012 on my development machine and
I am using a JDBC driver for Microsoft SQL Server 2012 (sqljdbc_4.0) and although
I have a SQL Server database which contains date like 2012-01-10 00:00:00.000 When I
I am using SQL Server 2012 RC0 + EF 4 + MVC 4. 90%
What are the SQL Server 2008 and SQL Server 2012 licence fees for a
I had SQL Server Express 2008, 2008 R2, and 2012 RC0 installed when I
I am using SQL server 2008, and I need to make a common delimeted
Does anyone know if Data Quality Services in Sql Server 2012 can be used
I created a new database ( AC_2012 ) on my localhost in SQL Server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.