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 is the basic diffrence betn a col declared in char(1) and in varchar(1)

2 Answers  


What is the difference between NOROW and LOCKROW?

0 Answers   Accenture, Honeywell, Satyam,


Write a query for primary key constraint with identity key word?

0 Answers   MindCracker,


Sql studio em braces a variety of capabilities, but will I need them all? Is there a simpler product ? : sql server management studio

0 Answers  


What does the not null constraint do?

0 Answers  






What is the difference between a clustered index and a non-clustered index?

0 Answers  


How to create and drop temp table in sql server?

0 Answers  


What is Left Outer Join?

2 Answers  


What is the use of Port no?

1 Answers   Wipro,


What is the datatype of rowid?

0 Answers  


What is normalization and its types?

0 Answers  


What happens if we shrink log file in sql server?

0 Answers  


Categories