SELECT * INTO dbo.newtable FROM dbo.oldtable WHERE 1 = 0;
Note that this creates the same column structure (including an IDENTITY column if one exists)
but it does not copy any indexes, constraints, triggers, etc.
If you want to make a copy of the table including all of the data, then leave out the WHERE clause.
SELECT * INTO dbo.newtable FROM dbo.oldtable
No comments:
Post a Comment