insert into select与select into from

use test
if (object_id('tbl_cursor') is null)
begin
 --select i_id,s_user,s_pass into tbl_cursor select i_id,s_user,s_pass  from test01--这是错误的
 select i_id,s_user,s_pass into tbl_cursor from test01
 select * into tbl_cursor from test01
 select * from tbl_cursor
 drop table tbl_cursor

 create table tbl_cursor(i_id int primary key,s_user varchar(20),s_pass varchar(20))
 insert into tbl_cursor(i_id,s_user,s_pass) select i_id,s_user,s_pass from test01
 select * from tbl_cursor
end

posted @ 2009-06-03 19:03  Talo  阅读(336)  评论(0编辑  收藏  举报