How to change the identity property in SQL Server 2008?

I have a table that does not have an identifier column. I want to change the column identifier specification, but SQL Server 2008 does not allow this. So how can I change the identity property in SQL Server 2008?

+4
source share
2 answers

under tools → options → designers → table and database developers

uncheck the box to prevent saving changes that require re-creating the table.

+13
source

If you want to add a new column as an identity column:

ALTER TABLE [tablename] ADD COLUMN [columnName] int NOT NULL IDENTITY(1,1) GO ALTER TABLE [tablename] ADD PRIMARY KEY ([columnName]) 

If you are trying to use the SQL 2008 constructor, there is a parameter that you must turn off so that the designer can reset and recreate the table.

+4
source

Source: https://habr.com/ru/post/1286687/


All Articles