create table 表(A int,b as A+1)

解决方案 »

  1.   

    用insert觸發器實現
    update 表 set b=a+1 from inserted where 表.a=inserted.a 默認值不能實現
      

  2.   

    回复人: rockyljt(Rocky) ( ) 信誉:100  2005-01-12 16:42:00  得分: 0  
     
     
       用insert觸發器實現
    update 表 set b=a+1 from inserted where 表.a=inserted.a 默認值不能實現
    -----------------------------------------------------------------
    表中包含了 ntext 字段.   inserted表不能使用ntext字段,  怎么办?  
     
      

  3.   

    --表中包含了ntext字段,但你的处理并不涉及到ntext字段,所以
    update 表 set b=a+1 from inserted where 表.a=inserted.a 
    没有问题,只是要注意 a 是表中的主键
      

  4.   

    错误107, 列前缀 ' inserted' 与 查询中所用的表名或别名不匹配.
      

  5.   

    update b set b=a.a+1 from inserted a,表 b where a.a=b.a