将A表中的a列内容插入到B表中的b列,如何写这条sql语句

解决方案 »

  1.   

    通过什么来关联啊
    一般是update b set column1=b.column1 from b bwhere column2=b.column2
      

  2.   

    一般是update a set column1=b.column1 from b bwhere column2=b.column2
      

  3.   

    insert B(b) select a from A
      

  4.   

    insert into B(b) select a from A
      

  5.   

    insert into B(b) select a from A
      

  6.   

    insert into B(b)
    select a from A
      

  7.   

    支持小楼的写法insert B(b) select a from A
      

  8.   

    alter table A add id int identity(1,1)
    alter table B add id int identity(1,1)update B set b=A.a
    from B,A
    where A.id=B.idalter table A drop column id
    alter table B drop column id
      

  9.   

    --将a表中信息更新到b表
    update b
    set b.InActive = c.InActive
    from (select InActive from a) c
    --将a表中信息添加到b表
    insert b(groups) select groups from a
      

  10.   

    select a into B(b) from A
      

  11.   

    insert into B表 (b) select a from A表