Previous Topic: SequenceNext Topic: Define a SQL Server 2012 Server Audit


Creating a Sequence in SQL Server 2012

Use the SQL Server Sequence Editor to define sequences in a SQL Server 2012 physical model.

Follow these steps:

  1. In Model Explorer, right-click Sequences, and click New.

    A Sequence is created.

  2. Right-click the Sequence and click Properties.

    The SQL Server Sequence Editor opens.

  3. (Optional) Edit the name of the Sequence.
  4. Select a Schema from the Schema drop-down list.
  5. Select a data type for the sequence from the Physical Data Type drop-down list.
  6. (Optional) Select the Generate checkbox to generate a SQL during forward engineering.
  7. Click the General tab and work with the following options:
    Starting Value

    Defines the first value that is returned by the sequence object.

    Limit: Greater than or equal to the minimum sequence object and smaller than or equal to the maximum sequence object.

    Default: Minimum value for an ascending sequence object and the maximum value for a descending sequence object.

    Increment By

    Defines the increment value of the sequence object when the Next Value For function is run. The Increment By value cannot be 0 but it can be a negative value.

    Specify Minimum Value

    Specifies the minimum value for the sequence object

    Specify Maximum Value

    Specifies the maximum value for the sequence object.

    Cycle Values

    Specifies that the sequence object restarts the sequence cycle when it exceeds minimum or maximum value.

    Cache Values

    Specifies that the sequence object creates a cache of sequence values to increase the performance of the application.

  8. (Optional) Click the Permissions tab to grant server level permission to a user.
  9. (Optional) Click the Comment tab and enter any comments that you want to associate with the sequence.
  10. (Optional) Click the UDP tab to work with user-defined properties for the sequence.
  11. (Optional) Click the Notes tab to view history information and view or edit user notes.
  12. Click Close.

    The SQL Server Sequence Editor is defined and the SQL Server Sequence Editor closes.

Note: To delete a sequence, right-click the sequence and click Delete.