alter table ADD column 字段名 int=0,not null

解决方案 »

  1.   

    看books online里面的alter table,我这里没有sqlserver
      

  2.   

    alter table 表名
    add 字段名 int not null
    alter table 表名
    add constraint 默认约束名 default(0) for 字段名
    go
      

  3.   

    修改表格
    格式:
    Alter table 表名  
        [add 新字段名 数据类型] 加入一个新字段
        [drop column 字段名] 删除一个字段
        [alter column 字段名 数据类型]如果要默认为0可以加一个默认 
    create default 缺省名
      as 常量
    sp_bindefault 缺省名,’对象’
      

  4.   

    alter table ADD column 字段名 int,default(0)
      

  5.   

    alter table 表名 add 字段名  not null
    alter table 表名 add default(0) for 字段名
      

  6.   

    alte table 表名 add 字段名 int default (0)
      

  7.   

    alter table 表名 add 列名 int default(0);