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

Материал из SQL эксперт
Версия от 13:24, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

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

   <source lang="sql">

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</source>


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

   <source lang="sql">

SELECT IDENT_SEED("YourTableName") IdentSeed</source>