利用臨時表操作(設原表為A) 在SQL SERVER 中的操作:Create Procedure AppendAfertChange As Select * into #B from A where d='2003' update #B set c=35 ,d=2004 insert into A (A,B,C,D) Select A,B,C,D from #B
楼主的描述比较含糊 究竟是更新还是插入楼上的方法是插入 保留了原来的数据如果是更新 set c=35, d='2004' form A where d='2003' and c=34
在SQL SERVER 中的操作:Create Procedure AppendAfertChange
As
Select * into #B from A where d='2003'
update #B set c=35 ,d=2004
insert into A (A,B,C,D) Select A,B,C,D from #B
究竟是更新还是插入楼上的方法是插入
保留了原来的数据如果是更新
set c=35, d='2004' form A where d='2003' and c=34