SQL Server/T-SQL Tutorial/Sequence Indentity/IDENT SEED

Материал из SQL эксперт
Перейти к: навигация, поиск

Identity Property: SELECT IDENT_SEED("customer"), IDENT_INCR("customer")

6> CREATE TABLE customer
7> (
8> cust_id      smallint        IDENTITY  NOT NULL,
9> cust_name    varchar(50)     NOT NULL
10> )
11> GO
1>
2> SELECT IDENT_SEED("customer"), IDENT_INCR("customer")
3> GO
---------------------------------------- ----------------------------------------
                                       1                                        1
(1 rows affected)
1>
2>
3> drop table customer;
4> GO


The IDENT_SEED function displays the originally defined seed value for the IDENTITY column of a specific table or referencing view.

SELECT IDENT_SEED("YourTableName") IdentSeed