Changing the maximum length of a varchar column?

后端 未结 9 1602
[愿得一人]
[愿得一人] 2021-01-30 12:02

I\'m trying to update the length of a varchar column from 255 characters to 500 without losing the contents. I\'ve dropped and re-created tables before but I\'ve never been expo

9条回答
  •  感情败类
    2021-01-30 12:35

    Increasing column size with ALTER will not lose any data:

    alter table [progennet_dev].PROGEN.LE 
        alter column UR_VALUE_3 varchar(500) 
    

    As @Martin points out, remember to explicitly specify NULL | NOT NULL

提交回复
热议问题