how to change a column which is the primary key for identity?

0

Well I made a table in the sqlserver and put the primary key as normal int but I need to change it to identity. how do i ??

    
asked by anonymous 04.09.2018 / 19:18

1 answer

2

You can change via command or via Management Studio. Via command you will have to remove the column and add it again:

ALTER TABLE Cliente
DROP COLUMN Id   

ALTER TABLE Cliente
ADD ID INT NOT NULL Identity(1,1)

via Management Studio:

    
04.09.2018 / 19:26