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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to check what was the last restore transaction LSN in Log shipping or Mirroring? when we don't have a Monitor or witness server.

3368


What specific conditions database should meet, before you can bulk copy data into it using bcp?

532


How to get a list of table columns using the "sp_columns" stored procedure in ms sql server?

551


What is the query and subquery?

614


How to execute a stored procedure in ms sql server?

543






What is a performance monitor?

552


What do you mean by data integrity?

589


What is subquery in sql?

566


What do you understand by SQL*Net?

611


What is command parameter in ssrs?

118


How to select all columns of all rows from a table with a select statement in ms sql server?

568


Define the one-to-one relationship while designing tables.

505


When would you use it?

572


What is attribute? : sql server analysis services, ssas

580


Why use view instead of a table?

512