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

后端 未结 30 2771
轮回少年
轮回少年 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条回答
  •  抹茶落季
    2020-11-22 12:17

    In SQL Server 2008-R2, I go to the design mode - in a test database - and add my two columns using the designer and made the settings with the GUI, and then the infamous Right-Click gives the option "Generate Change Script"!

    Bang up pops a little window with, you guessed it, the properly formatted guaranteed-to-work change script. Hit the easy button.

提交回复
热议问题