Select IDENTITYCOL
13>
14> -- SELECT Statement and IDENTITY Property
15>
16> CREATE TABLE product
17> (product_no INTEGER IDENTITY(10000,1) NOT NULL,
18> product_name CHAR(30) NOT NULL,
19> price MONEY)
20>
21> insert into product (product_name) values ('Soap');
22> GO
(1 rows affected)
1>
2> SELECT IDENTITYCOL
3> FROM product
4> WHERE product_name = 'Soap'
5> GO
product_no
-----------
10000
(1 rows affected)
1>
2> drop table product
3> GO
1>
Related examples in the same category