RE: copy of table

RE: copy of table

 

  

SELECT * INTO NEW_TABLE FROM OLD_TABLE WHERE 1 = 0;

Note that if an unsatisfiable where rule is specified as in your example a
table will be created with identical definition but no data.

Check BOL - especially for earlier versions of MSSQL.

> -----Original Message-----
> From: Shibu MB [SMTP:[Email Address Removed] Sent: Thursday, November 21, 2002 11:58 AM
> To: LazyDBA.com Discussion
> Subject: copy of table
>
> Hi all
>
> How can i create a copy of an existing table with different name .?
> Like "create table < new tablename > as select * from emp where 1 =
> 0 "
> in oralce what is the corresponding query in sqlserver ?
>
> Thanks
> Shibu
MS Sql Server LazyDBA home page