Sequences Wizard (SQL Server)

From DBArtisan
Jump to: navigation, search

Go Up to Microsoft SQL Server Object Wizards

This wizard builds and submits a CREATE SEQUENCE statement.

To create a new full-text catalog using a wizard:

  1. Open a creation wizard for a sequence. For details, see Opening an Object Wizard.
  2. Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:
  3. Finally, use the Execute button to create the object.

Sequences (SQL Server) - Properties

When creating or editing a sequence, this tab/panel lets you work with the following settings:

Setting Description

Schema and Name

Lets you provide identification for the sequence.

Start With

Lets you provide a START WITH argument value, specifying the first value to be returned by the sequence.

Increment By

Lets you provide an INCREMENT BY argument value, specifying the value by which to increment (or decrement if negative) the sequence object for each call to the NEXT VALUE FOR function.

Minimum Value and Maximum Value

Lets you provide MINVALUE and MAXVALUE argument values, specifying the bounds for this sequence.


If selected, a CYCLE argument is generated, specifying that sequence values should restart from the minimum value (or maximum for descending sequences) or throw an exception when the minimum/maximum value is exceeded. If unselected, the default NO CYCLE is assumed.

Cache and Cache Size

If Cache is unselected, a NO CACHE argument is generated. If Cache is selected, a CACHE argument is generated. A CACHE argument value can be provided using the Cache Size control, and if no Cache Size value is provided, SQL Server will generate a value.

Data Type Schema, Data Type Name, and Data Type Precision

These controls let you build an AS argument, specifying datatype details for the new sequence. If no values are selected/provided, SQL Server will, by default, generate a sequence object of type BIGINT. After selecting a Data Type Schema, the Data Type Name dropdown is populated with user datatypes created from a base datatype of BIGINT, TINYINT, SMALLINT, INT, BIGINT, DECIMAL, or NUMERIC. Data Type Precision is a read-only field displaying the precision of the selected user datatype. NOTE: You can use system types if you select a Data Type Schema of SYS.

After creation, the Sequences Editor lets you view the current value of the sequence and whether the maximum value has been exceeded. For details. see Sequences Editor (SQL Server).