It’s possible to set up the Identity property when you create the table.
CREATE TABLE [dbo].[T22] (
[T22_Key] [int] IDENTITY (1, 1) NOT NULL ,
[Profile_Key] [int] NULL )
ON [PRIMARY]
If the table was created without Identity using script:
CREATE TABLE [dbo].[T22] (
[T22_Key] [int] NOT NULL ,
[Profile_Key] [int] NULL )
ON [PRIMARY]
Is it possible to add Identity property on the existing column using alter table statement?
This doesn’t work:
alter table T22 alter column T22_Key int IDENTITY (1, 1) NOT NULL
Are there any ways to set Identity programmatically through script?