본문 바로가기
Cito 일/SQL

[SQL] MSSQL, ORACLE 테이블 복사하기

by citopes 2015. 6. 11.
반응형





MSSQL 테이블 복사
1. 전체복사

select * into TABLENAME_BAK from TABLENAME where '1'='1';

2. 테이블구조만 복사 (데이터제외)

select * into TABLENAME_BAK from TABLENAME where '1'='2';



oracle 테이블 복사
1. 전체복사

create table TABLENAME_BAK as select * from TABLENAME

2. 테이블구조만 복사 (데이터제외)

create table TABLENAME_BAK as select * from T_TABLENAME where 1=0;

 

 



반응형

댓글