how to copy an existing table to new table in SQL Server. There are two options. They are
SELECT * INTO tableNew FROM tableOld WHERE 1=2
The above query will copy the structure of an existing table(tableOld) into the new table(tableNew).
Copy only the structure with data of an existing table into new table:
SELECT * INTO tableNew FROM tableOld
- Copy only the structure of an existing table into new table
- Copy only the structure with data of an existing table into new table
SELECT * INTO tableNew FROM tableOld WHERE 1=2
The above query will copy the structure of an existing table(tableOld) into the new table(tableNew).
Copy only the structure with data of an existing table into new table:
SELECT * INTO tableNew FROM tableOld