把數據導出來後,創建一個表,然後把導出表的數據用
insert into 新表 select * from 導出表
這樣新表的列標師說出來了。update a set aprice='aaa',cont=123,cuprice=12.5 where .......

解决方案 »

  1.   

    原表是xsact,导出的表比如是xsact2,在xsact2里修改了100条数据,现在要把这100条数据更新到xsact里。
    主要更新三个字段aprice       cont      cuprice
      

  2.   

    我要实现这样的效果:
    update xsact set aprice=xsact2里的aprice,cont=xsact2里的cont,cuprice=xsact2里的cuprice where xsact里的porder=xsact2里的porder and xsact里的eda=xsact2里的eda and xsact里的bun=xsact2里的bun具体怎么写啊?
      

  3.   

    如果那更改过的100条数据存为xsact2,以下方法可以吗?
    DECLARE @_porder varchar(20), @_eda varchar(20),@_bun varchar(20),@_aprice decimal(28,6),@_cont varchar(255),@_cuprice decimal(28,6)
    DECLARE changePrice_cursor CURSOR FOR
    select porder,eda,bun,aprice,cont,cuprice from xsact2
    open  changePrice_cursor
    FETCH NEXT FROM changePrice_cursor
    into @_porder,@_eda,@_bun,@_aprice,@_cont,@_cuprice
    WHILE @@FETCH_STATUS = 0
    begin
    update xsact set aprice=@_aprice,cont=@_cont,cuprice=@_cuprice where porder=@_porder and eda=@_eda and bun=@_bun
    FETCH NEXT FROM changePrice_cursor
    into @_porder,@_eda,@_bun,@_aprice,@_cont,@_cuprice
    end
    CLOSE changePrice_cursor
    DEALLOCATE changePrice_cursor