Only structure
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).
Structure and Data both
SELECT * INTO tableNew FROM tableOld
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).
Structure and Data both
SELECT * INTO tableNew FROM tableOld
How to copy a table into new table with/without data in SQL Server?
Reviewed by kamal kumar das
on
October 24, 2011
Rating:
No comments: