Hi every one Nice job! Using of Sql Express Management Studio 2008 GUI(not with coding),how can I make a primary key auto-incremented? Let me explain,there is a table which has a column named "id" and the items of this column are set to be primary keys. I want to make this column auto-incremented,but how? Cheers
+2
A:
Presumably you are in the design of the table (right click table name - design).
Click the required column.
In column properties
at the bottom, there is identity specification
expand it, then toggle is identity
to yes
Chris Diver
2010-07-29 02:57:21
+1
A:
Right-click on the table in SSMS, 'Design' it, and click on the id column. In the properties, set the identity to be seeded @ e.g. 1 and to have increment of 1 - save and you're done.
Will A
2010-07-29 02:57:31
"identity" and ""identity seed" are disabled.how can i enable them?
Saeidmscs
2010-07-29 03:05:29
As per other responses, you'll need to mark the column as being an identity column beforehand - set `is identity` to 'yes'
Will A
2010-07-29 03:12:49
+1
A:
I don't have Express Management Studio on this machine, so I'm going based on memory. I think you need to set the column as "IDENTITY", and there should be a [+] under properties where you can expand, and set auto-increment to true.
Cambium
2010-07-29 02:58:09