Copy table schema only
Need to duplicate a table’s schema? Use a SELECT…INTO…FROM statement:
SELECT * INTO new_tbl
FROM old_tbl
This will create a copy of the table, data and all. What if you don’t want the data copied with the schema? My friend Alessandro Basso uses this method:
SELECT * INTO new_tbl
FROM old_tbl
WHERE 1=2
Genius!
Posted on June 29, 2011, in SQL Server. Bookmark the permalink. Leave a Comment.

development and administration, he enjoys C#.NET and Linux development.

Leave a Comment
Comments (0)