Try:create proc T_proc
as
   insert t2 select id,title,content from t1 where w='1'

解决方案 »

  1.   

    create proc sp_test
    asinsert into t2(id,title,content)
    select id,title,content
    from t1
    where w='1'
    go
    --执行
    exec sp_test
      

  2.   

    --1.表t2(id,title,content) 中ID不是自增量:
    create proc T_proc
    as
    insert t2 select * from t1 where w='1'
    --2.表t2(id,title,content) 中ID不是自增量:
    create proc T_proc
    as
    insert t2 select title,content from t1 where w='1'
      

  3.   

    --上面第2条描述写返了
    --1.表t2(id,title,content) 中ID不是自增量:
    create proc T_proc
    as
    insert t2 select * from t1 where w='1'
    --2.表t2(id,title,content) 中ID是自增量:
    create proc T_proc
    as
    insert t2 select title,content from t1 where w='1'
      

  4.   

    表t1的id是标识种子 自增量 表t2中id当然不是自增量
    用不用什么循环控制语句或什么指针下移等技术呢?
      

  5.   

    有一表t1(id,title,content,w)和一表t2(id,title,content) 求一存储过程:如何才能把表t1中  所有w='1'的记录拷贝到 t2中?要求每一次都让t2表中id='1'