Add column to SQL Server

前端 未结 5 1881
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-13 05:27

I need to add a column to my SQL Server table. Is it possible to do so without losing the data, I already have?

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-13 06:06

    Use this query:

    ALTER TABLE tablename ADD columname DATATYPE(size);
    

    And here is an example:

    ALTER TABLE Customer ADD LastName VARCHAR(50);
    

提交回复
热议问题