现有表结构随意,增加三列,如下:
ProductID(uniqueidentifier) 
ModuleID(uniqueidentifier) 
QuestionType(int ,not null)1.  ProductID,ModuleID都允许为空
2.  QuestionType(问题类型)不允许为空
请问SQL语句该怎么写?

解决方案 »

  1.   

    alter table tb
    add ProductID uniqueidentifier 
    go
    alter table tb
    add ModuleID uniqueidentifier 
    go
    alter table tb
    add QuestionType int not null
      

  2.   

    1.
    alter table tb add ProductID int
    alter table tb add ModuleID int
      

  3.   

    2.alter table tb
    add QuestionType int not null
      

  4.   

    1、alter table tb add ProductID uniqueidentifier
    alter table tb add ModuleID uniqueidentifier
    2、alter table tb add QuestionType int not null
      

  5.   

    感谢大家帮忙,我发现我没有表述清,更新下需求
    1.物理表中已经有了记录,在此基础上做修改
    2.QuestionType 默认为0
      

  6.   

    alter table tb add QuestionType int  default '0'