Hello
I'm trying to find the ALTER syntax to set Primary Key and Identity to an existing Column
I'm looking around internet but this is the jungle to find pertinent or efficient SQL Syntax description
!
Here is the DDL ogf my table I need to set MyKey as Primary Key and Identity ?
CREATE TABLE [dbo].[Test](
[MyKey] [int] NULL,
[Name] [varchar](50) NULL
)
I have another little question : I see that if SSMS generate the CREATe Sript for this Table there is an added command "ON Primary"
CREATE TABLE [dbo].[Testu](
[MyKey] [int] NULL,
[Name] [varchar](50) NULL
) ON [PRIMARY]
what is the purpose of that ON PRIMARY ?
It is also not clear !
Thanks for your help