有关同时使用CREATE SEQUENCE和NEXT VALUE FOR函数的信息,请参阅序列号。 Transact-SQL 语法约定 语法 syntaxsql CREATESEQUENCE[schema_name. ]sequence_name[AS[built_in_integer_type| user-defined_integer_type] ] [STARTWITH<constant>]
创建序列后,您可以在 SQL 语句中使用CURRVAL伪列返回序列当前值或使用NEXTVAL伪列返回递增的新值。详细信息,请参见序列伪列。 语法 CREATESEQUENCE[schema.]sequence_name {STARTWITHint_value|[INCREMENTBYint_value]|[MINVALUE int_value|NOMINVALUE]|[MAXVALUE int_value|NOMAXVALUE]|[CACHE int_value|NOCACHE]...
向当前数据库里增加一个新的序列。序列的Owner为创建此序列的用户。SEQUENCE是一个存放等差数列的特殊表,该表受DBMS控制。这个表没有实际意义,通常用于为行或者表生成唯一的标识符。如果给出一个模式名,则该序列就在给定的模式中创建,否则会在当前模式中创建。序列名必
syntaxsql CREATESEQUENCE[schema_name. ]sequence_name[AS[built_in_integer_type| user-defined_integer_type] ] [STARTWITH<constant>] [INCREMENTBY<constant>] [ {MINVALUE[<constant>] } | {NOMINVALUE} ] [ {MAXVALUE[<constant>] } | {NOMAXVALUE} ] [CYCLE| {NOCYCLE} ] [ {CACHE[<constant...
For information about sequences, query sys.sequences. Security Permissions Requires CREATE SEQUENCE, ALTER, or CONTROL permission on the SCHEMA. Members of the db_owner and db_ddladmin fixed database roles can create, alter, and drop sequence objects. Members of the db_owner and db_datawriter...
syntaxsql Copiar CREATE SEQUENCE [schema_name . ] sequence_name [ AS [ built_in_integer_type | user-defined_integer_type ] ] [ START WITH <constant> ] [ INCREMENT BY <constant> ] [ { MINVALUE [ <constant> ] } | { NO MINVALUE } ] [ { MAXVALUE [ <constant> ] } | { NO ...
In SQL Server, the sequence is a schema-bound object that generates a sequence of numbers either in ascending or descending order in a defined interval. It can be configured to restart when the numbers get exhausted. A Sequence is not associated with any table. You can refer a sequence to...
For information about sequences, query sys.sequences. Security Permissions Requires CREATE SEQUENCE, ALTER, or CONTROL permission on the SCHEMA. Members of the db_owner and db_ddladmin fixed database roles can create, alter, and drop sequence objects. Members of the db_owner and db_datawriter...
For information about sequences, query sys.sequences. Security Permissions Requires CREATE SEQUENCE, ALTER, or CONTROL permission on the SCHEMA. Members of the db_owner and db_ddladmin fixed database roles can create, alter, and drop sequence objects. Members of the db_owner and db_datawri...
The next value for the sequence object is calculated. The new current value for the sequence object is written to the system table. The calculated value is returned to the calling statement. Metadata For information about sequences, querysys.sequences. ...