How to copy/append data from one table into another table with same schema in SQL Server?
Edit:
let's say there is a query
select *
into table1
from table2
where 1=1
which creates table1
with the same schema as well as data as in table2
.
Is there any short query like this to only copy entire data only into an already existing table?
Best Answer
If both tables are truly the same schema:
Otherwise, you'll have to specify the column names (the column list for
newTable
is optional if you are specifying a value for all columns and selecting columns in the same order asnewTable
's schema):