复制表大全(转载)
1. 复制表结构及其数据:
Oracle:create table emp2 as select * from emp;
SQLServer:SELECT * INTO t FROM t_score;
2. 只复制表结构:
Oracle:
create table emp2 as select * from emp where 1=0;
或
create table emp2 like emp ;
SQLServer:
SELECT * INTO t FROM t_score where 1=0;
3. 只复制表数据:
两个表结构一样:
Oracle和sql一样:
insert into emp2 select * from emp;
两个表结构不一样:
insert into emp2(e1,e2...) select e1,e2... from emp;