解决方案 »

  1.   

    补充说明,不用cursor,只能一条语句就实现对所有数据的插入,也就是one time insert
      

  2.   

    比如你要插入id字段值,可以这样:declare @col nvarchar(100);set @col = 'id'
    insert into C(store_id,attribute_value)
    select (select store_id from B where attribute_name = @col),
           cast(ID as nvarchar)
    from A