1:表随便定
2:用触发器
  if Exists(select * from inserted where a is null and b is null and c is null)
  raiserror('不能全为空',16,-1)
  rollback

解决方案 »

  1.   

    create table #a (a int check(a is not null),b int check(a is not null),c int check(a is not null))??
      

  2.   

    不能用触发器,但是大力你的我觉得不对!a,b,c 可以为空,但是不能都为空,这个题目确实是要用Check,我就是不知道这个Check如何写。
    平常没有写过Check!
      

  3.   

    我測試過大力的是對的
    create table #a (a int check(a is not null),b int check(b is not null),c int check(c is not null))
      

  4.   

    --测试:
    create table #a (
    a int,
    b int,
    c int,
    constraint a check(not (a is null and b is null and c is null)),
    constraint b check(not (a is null and b is null and c is null)),
    constraint c check(not (a is null and b is null and c is null)),
    )
    insert into #a(a,b,c) values(2,null,null) --成功
    insert into #a(a,b,c) values(null,2,null) --成功
    insert into #a(a,b,c) values(null,null,2) --成功
    insert into #a(a,b,c) values(null,null,null) --失败
      

  5.   

    Check约束可以被创建或增加为一个表约束,当Check约束保护多个数据列时,必须使用表约束语法。
    CONSTRAINT [constraint_name] CHECK (condition);
      

  6.   

    列约束和表约束
    约束可以是列约束或表约束: 列约束被指定为列定义的一部分,并且仅适用于那个列(前面的示例中的约束就是列约束)。
    表约束的声明与列的定义无关,可以适用于表中一个以上的列。 
    当一个约束中必须包含一个以上的列时,必须使用表约束。例如,如果一个表的主键内有两个或两个以上的列,则必须使用表约束将这两列加入主键内。假设有一个表记录工厂内的一台计算机上所发生的事件。假定有几类事件可以同时发生,但不能有两个同时发生的事件属于同一类型。这一点可以通过将 type 列和 time 列加入双列主键内来强制执行。CREATE TABLE factory_process
       (event_type   int,
       event_time   datetime,
       event_site   char(50),
       event_desc   char(1024),
    CONSTRAINT event_key PRIMARY KEY (event_type, event_time) )
      

  7.   

    我刚在企业管理器中建了一个表,生成脚本如下:
    CREATE TABLE [dbo].[TABLE1] (
    [a] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [b] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [c] [char] (10) COLLATE Chinese_PRC_CI_AS NULL 
    ) ON [PRIMARY]
    GOALTER TABLE [dbo].[TABLE1] WITH NOCHECK ADD 
    CONSTRAINT [CK_TABLE1] CHECK ([a] is not null or [b] is not null or [c] is not null)
    GO
      

  8.   

    create table #a (
    a int,
    b int,
    c int,
    constraint ck_#a check(not (a is null and b is null and c is null)),
    )
      

  9.   

    呵呵,没看清题目create table #a (a int ,b int ,c int, check(not (a is null and b is null and c is null)))
      

  10.   

    面试通知来了——我被刷下来了!现在给我一个机会去试试Windows support,可我最喜欢的是SQL Server阿!
    假如能成Windows support也还不错!毕竟它是微软!!我喜欢的SQL Server!!!...
    ...
    ...
      

  11.   

    同情!不过我想如果你Windows support做的好的话,在同一个公司里还是有机会换的
      

  12.   

    check(not (a is null and b is null and c is null))