alert table1 drop column1 
其中column1 有默认值
删除失败,应该怎么写哪

解决方案 »

  1.   


    alert table table1 drop column column1 
      

  2.   

    ALTER TABLE [TABLENAME] DROP COLUMN [COLUMNNAME]
      

  3.   

    alter table table1
    drop constraint 約束名alter table table1
    drop column column1
      

  4.   

    alert table 表名 drop column 字段名
      

  5.   

    --改
    alter table 表名 drop column 字段名
      

  6.   

    在对象浏览器里找到列名  然后查看约束  如果不想用语法删可以直接右键删除默认约束
    如果使用语法
    使用 sp_helpconstraint 表 可以查看表约束名alter table 表 drop constraint 约束名称
    alter table 表 drop column 字段
      

  7.   

    alter table 表名 drop constraint 约束名
    alter table 表名 drop column 列名
      

  8.   

    这为兄弟,删除一个列之前必须检查该列上是否有约束~删除约束,再删除列。查看一张表的约束:exec sp_helpconstraint  表名如果有约束则先删除约束
    alter table 表名 drop constraint 约束名接着删除列
    alter table 表名 drop column 列名