Add a column to existing table and uniquely number them on MS SQL Server

前端 未结 8 1288
暖寄归人
暖寄归人 2020-12-04 08:16

I want to add a column to an existing legacy database and write a procedure by which I can assign each record a different value. Something like ad

8条回答
  •  星月不相逢
    2020-12-04 08:43

    Just using an ALTER TABLE should work. Add the column with the proper type and an IDENTITY flag and it should do the trick

    Check out this MSDN article http://msdn.microsoft.com/en-us/library/aa275462(SQL.80).aspx on the ALTER TABLE syntax

提交回复
热议问题