not working
ALTER TABLE ProductInProduct ALTER COLUMN Id KEY IDENTITY (1, 1);
Check Image
I have a table ProductInProduct is want its id should be Unique..
You don't set value to default in a table. You should clear the option "Default value or Binding" first.
You cannot "convert" an existing column into an IDENTITY
column - you will have to create a new column as INT IDENTITY
:
ALTER TABLE ProductInProduct
ADD NewId INT IDENTITY (1, 1);
Update:
OK, so there is a way of converting an existing column to IDENTITY
. If you absolutely need this - check out this response by Martin Smith with all the gory details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With