set identity on the column

前端 未结 6 1426
清歌不尽
清歌不尽 2020-12-10 20:42

How can I modify table and set identity on PK column using T-SQL?

thanks for help

6条回答
  •  攒了一身酷
    2020-12-10 21:12

    In fact, you can modify the IDENTITY on a column. Please read through this article http://www.sqlmag.com/article/tsql3/adding-the-identity-property-to-an-existing-column.aspx

    It will need a lot more code than ALTER TABLE tab ALTER COLUMN col SET IDENTITY, though

提交回复
热议问题