Creating a Sequence in SQL Server
Use the SQL Server Sequence Editor to define sequences in a SQL Server 2012, 2014, or 2016 physical model.
Follow these steps:
- In Model Explorer, right-click Sequences, and click New.
A Sequence is created.
- Right-click the Sequence and click Properties.
The SQL Server Sequence Editor opens.
- (Optional) Edit the name of the Sequence.
- Select a Schema from the Schema drop-down list.
- Select a data type for the sequence from the Physical Data Type drop-down list.
- (Optional) Select the Generate checkbox to generate a SQL during forward engineering.
- 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.
- (Optional) Click the Permissions tab to grant server level permission to a user.
- (Optional) Click the Comment tab and enter any comments that you want to associate with the object.
- (Optional) Click the UDP tab to work with user-defined properties for the object.
- (Optional) Click the Notes tab to view and edit user notes.
- 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.
Copyright © 2018 erwin, Inc.
All rights reserved.
|
|