To insert all records of a table into a new table in the SQLserver, we can use the
INSERT INTO SELECT command.
An example is demonstrated below:
Let the table with the records be:
TABLE1
column1
column2
column3
123
Mike
Adams
345
John
Jacob
567
John
Joel
Our task is to transfer the records from TABLE1 to a new table named TABLE2. We have created TABLE2 and inserted the values into it, as demonstrated below:
Here is the table with the data inserted:
TABLE2
column1
column2
column3
345
John
Jacob
567
John
Joel
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
To insert all records of a table into a new table in the SQL server, we can use the INSERT INTO SELECT command.
An example is demonstrated below:
Let the table with the records be:
TABLE1
Our task is to transfer the records from TABLE1 to a new table named TABLE2. We have created TABLE2 and inserted the values into it, as demonstrated below:
Here is the table with the data inserted:
TABLE2