How to insert all records of a table into a new table in the SQL server?
How to insert all records of a table into a new table in the SQL server?
499
22-Mar-2023
Updated on 22-Mar-2023
Krishnapriya Rajeev
24-Mar-2023To 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