Add a column with a default value to an existing table in SQL Server

后端 未结 30 2607
轮回少年
轮回少年 2020-11-22 12:00

How can I add a column with a default value to an existing table in SQL Server 2000 / SQL Server 2005?

30条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 12:07

    SQL Server + Alter Table + Add Column + Default Value uniqueidentifier

    ALTER TABLE Product 
    ADD ReferenceID uniqueidentifier not null 
    default (cast(cast(0 as binary) as uniqueidentifier))
    

提交回复
热议问题