alter table customer alter column customercode varchar(40) not null

解决方案 »

  1.   

    标识列 'customercode' 的数据类型必须是 int、bigint、smallint、tinyint 或 decimal 数据类型,或者小数位数为 0 的 numeric 数据类型,并且约束为不可为空。
      

  2.   

    你的字段有的为空!!或者是标识列不能为字符串
    查找字段为空:
    select * from customer where customercode is null
      

  3.   

    只有列中不包含空值时,ALTER COLUMN 中才可指定 NOT NULL。必须将空值更新为非空值后,才允许执行 ALTER COLUMN NOT NULL 语句
      

  4.   

    已经是非空了,那个错误是前面报出来的,执行alter table customer alter column customercode varchar(40) 一样报错的.