select XXX into 和 Insert into XXX select

检索一个表中的部分行存到另一张表中。

一 、另外的那张表没有新建的时候,使用 select XXX into,创建的表与原表有相同的列名和类型:

select *
into Departments_Copy
from Departments
where Departments.ID>100

二、另外的那张表已经新建的时候,使用Insert into XXX select:

insert into Departments_Copy
select *
from Departments

 

posted @ 2014-04-02 19:50  niaomingjian  阅读(683)  评论(0编辑  收藏  举报