比如有2个表table1, table2,
table1里有个name1列, table2里有个name2列如果在sql2005里执行,把name1列读出来, 然后在table2表里自动加入新行, 写进table1的name1列呢, 

解决方案 »

  1.   

    insert into table2(name2) select name1 from table1
      

  2.   

    select name1 from table1 
    然后怎么把读出的列, 在table2表里 全写进新列呢(别的都为空没事,只写进一个列)然后我还想把table1里的一个age1列, 读出来,然后写入 table2,的age2列
      

  3.   

    insert into table2(age2) select age1 from table1
    .....
    干嘛分开搞。insert into table2(name2,age2) select name1,age1 from table1
      

  4.   

    1、个别字段
    insert into table2(name2,age2) select name1,age2 from table12、全字段
    insert into table2 select * from table1
    前提条件,table1与table2结构相同.不知道是不是你想要的!
      

  5.   

    insert into table2(name2,age2) select name1,age1 from table1
      

  6.   

    楼上正解
    你也可以参考SqlServer的帮助文档,有意外的收获的...
    比如不确定的列值(top(count))也可以得
      

  7.   

    insert into T1 (name1) select name2 from T2.