auto increment option
I need开发者_开发技巧 to set the auto increment option for a particular column in a row of a database to be true so that the value increments each time a new row is inserted.
How do i do that?
You can use IDENTITY property in TSQL
CREATE TABLE new_employees
(
id_num int IDENTITY(1,1),
fname varchar (20),
minit char(1),
lname varchar(30)
);
Try this
The database column itself must be specified to be an identity...
- Using SQL Management Studio, open the table
- Expand the
Identity Specificationtree - Alter the value of
Is IdentitytoYes Identity Incrementwill now be1, change it if necessary
加载中,请稍侯......
精彩评论