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 different acid properties?

0 Answers  


What is the diff between Dynamic queries and static queries

1 Answers   CGG, ICS Integrated Computer Solutions,


Which are ddl commands?

0 Answers  


To which devices can a backup be created and where should these devices be located? : sql server management studio

0 Answers  


How do we know if any query is retrieving a large amount of data or very little data?

0 Answers  






How to use union to merge outputs from two queries together in ms sql server?

0 Answers  


what is checksum in sql server.........???

0 Answers   TCS,


How you can find out if an index is useful to the optimizer?

0 Answers  


List down some advantages of sql stored procedure?

0 Answers  


How to Execute an Operating System Command From Within SQL Server ?

3 Answers  


UPDATE statement can on a single table or on the multiple table?

7 Answers   iGate, TCS,


can an automatic recovery be initiated by a user? : Sql server administration

0 Answers  


Categories