SQL Server : how to alter already existing auto_increment for a column

Viewed 2214

I have this table

CREATE TABLE [dbo].[MyTable]
(
    [MyTableId] [int] IDENTITY(1,1) NOT NULL, 
    [Description] [varchar](50) NOT NULL, 
    CONSTRAINT [PK_MyTable] 
        PRIMARY KEY CLUSTERED  ([MyTableId] ASC)
)

It already has the IDENTITY (1,1). What I want is to change the auto increment to 2 instead of 1. How do I do that?

I found some answers that says I need to drop the column and create a new one but I'm not sure if there is a simpler solution. Also, I found out that I can do it using SSMS -> Tools -> Options -> Designers -> Table and Database Designers but what I want is the script that I can run as a SQL script.

Thanks!

1 Answers
Related