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

What are the advantages of user defined function?

0 Answers  


What command do we use to rename a db?

5 Answers   IBM,


What is a natural primary key?

0 Answers  


Do you know how to implement service broker?

0 Answers  


How to delete existing triggers using "drop trigger"?

0 Answers  


How do you start single user mode in clustered installations?

0 Answers  


What do you mean by authentication modes in sql server?

0 Answers  


What command is used to delete a table from the database in the sql server and how?

0 Answers  


What are trace flags?

0 Answers  


what is difference between having and where clause ?

3 Answers  


How to Run a Query on a Remote SQL Server?

2 Answers  


What is the impact on other user sessions when creating indexes?

0 Answers  


Categories