How create table structure only from tableA to TableB if
TableA have some data?

Answers were Sorted based on User's Feedback



How create table structure only from tableA to TableB if TableA have some data?..

Answer / anand.kv

SELECT TOP 0 * INTO tableB FROM tableA

Is This Answer Correct ?    16 Yes 0 No

How create table structure only from tableA to TableB if TableA have some data?..

Answer / sunny

to copy only the structure
select * into table2 from table1 where 1=2
to copy the table along with the records
select * into table2 from table1 where 1=1

Is This Answer Correct ?    12 Yes 0 No

How create table structure only from tableA to TableB if TableA have some data?..

Answer / karthik

Create table emp1
as
select * from emp
where 1=2


It will give the structure of the table.

Is This Answer Correct ?    3 Yes 3 No

How create table structure only from tableA to TableB if TableA have some data?..

Answer / mits

Create table newtablename
from oldtablename
where 1=2

Is This Answer Correct ?    4 Yes 6 No

Post New Answer

More SQL Server Interview Questions

Suppose you want to implement the many-to-many relationships while designing tables. How would you do it?

1 Answers  


How do you run a trace?

1 Answers  


What is a benefit of using an after insert trigger over using a before insert trigger?

1 Answers  


When would you use a before or after trigger?

1 Answers  


What is checkpoint in sql server?

1 Answers  


Why and when do stored procedure recompile?

0 Answers  


How do you connect 100 files as a flat file sources in one package of SSIS?

2 Answers  


What are the properties of the relational tables?

1 Answers  


Why SQL Agent is used?

1 Answers   Abacus,


How do we get month name in SQL Server 2000, Oracle, MS Access?

11 Answers  


What is data modeling and Reterminal integrity?

1 Answers  


How to create a view using data from another view?

1 Answers  


Categories