ویرایش فیلد پایگاه داده برای کلید و مقدار پیش فرض

alter table [tableName]

add [fieldName] int identity(1,1)


alter table [tableName]

ADD PRIMARY KEY ([fieldName])


Expamle:

alter table attachment

add id int identity(1,1)


alter table attachment

ADD PRIMARY KEY (id)