insert into useraddFunctions(列1,2,3) 
 select Formtag,buttontag,@varuserid   from rolefunctions WHERE rolecode=@varrolecode

解决方案 »

  1.   

    insert into useraddFunctions(列1,2,3) 
     select Formtag,buttontag,@varuserid   from rolefunctions WHERE rolecode=@varrolecode
    用select 得到數據插入時要加上相應的字段名
      

  2.   

    CREATE TRIGGER [TRIGGER NAME] ON [dbo].[USERID] 
    FOR INSERT
    AS
     insert into useraddFunctions(Formtag,buttontag,userid)  --写对应的字段
     select r.Formtag,r.buttontag,i.userid   
    from rolefunctions r,inserted i 
    WHERE r.rolecode=i.rolecodego
      

  3.   

    应该参考一下SQL SERVER2K的相关书籍。
      

  4.   

    Rotaxe(程序员)
     wutao411(wutao411) 
     CCEO(CSDN的CEO??)  
       这样写它实际使用的时候提示:键列信息不足或不正确,更新影响到多行
       是什么原因导致的呀?
    lxf21(凌波微步)
       我就是要在insert aa表的时候提取userid信息,到bb查找对应信息,然后插入到cc表中