SELECT IDENT_CURRENT('customer') : IDENT_CURRENT « Sequence Indentity « SQL Server / T-SQL Tutorial






2> CREATE TABLE customer
3> (
4> cust_id      smallint        IDENTITY(100, 20)  NOT NULL,
5> cust_name    varchar(50)     NOT NULL
6> )
7> GO
1>
2> SELECT IDENT_CURRENT('customer')
3> GO

----------------------------------------
                                     100

(1 rows affected)
1>
2> drop table customer;
3> GO
1>








15.4.IDENT_CURRENT
15.4.1.Discover what the last IDENTITY value:you can use the IDENT_CURRENT function.
15.4.2.SELECT IDENT_CURRENT('customer')