How to copy a table into new table with/without data in SQL Server?

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
How to copy a table into new table with/without data in SQL Server? How to copy a table into new table with/without data in SQL Server? Reviewed by kamal kumar das on October 24, 2011 Rating: 5

No comments:

ads 728x90 B
Powered by Blogger.