Home > DeveloperSection > Interviews > How will you copy the structure of a table without copying the data?

Posted on    September-17-2011 1:45 AM

 MSSQL Server MSSQL Server 
Ratings:
 2 Answer(s)
  1394  View(s)
Rate this:

Chris Anderson
Chris Anderson

Total Post:197

Points:985
Posted on    September-17-2011 12:00 AM

There is one method for copying the structure of table without copying the data is

create table NEWTABLE as select * from OLDTABLE where 1=2



Shekhar Kumar
Shekhar Kumar

Total Post:1

Points:5
Posted on    August-06-2014 12:00 AM

There is one method for copying the structure of table without copying the data is
SELECT * INTO NewTable FROM OldTable Where 1=2

Don't want to miss updates? Please click the below button!

Follow MindStick