SQL怎样将一个表的数据,插入到另一个表中

来个语句看看``````

如果是oracle就是insert into table1 select * from table2
温馨提示:答案为网友推荐,仅供参考
第1个回答  2010-11-22
用游标实现!
declare cursor_name cursor for select column1,column2,from table1 where 。。。
declare @col1 column1_type
declare @col2 column2_type
open cursor_name
WHILE @@FETCH_STATUS = 0
begin
fetch next from cursor_name into @col1,@col2
insert table2(column_name1,column_name2) values(@col1,@col2)
end

close cursor_name
第2个回答  2010-11-22
insert 表a select * from 表b
相似回答