[thelist] [tip] duplicate a table structure

Joshua Olson joshua at waetech.com
Sun Oct 12 21:53:28 CDT 2003


<tip type="SQL" author="Joshua Olson">
If you need a quick way to duplicate a table structure in SQL Server and
can't get into EM, you can use the following SQL:

SELECT TOP 1 *
INTO newtable
FROM oldtable

TRUNCATE TABLE newtable

It'll copy the column definitions.  If you want to set up the default
values, indexes, etc, you'll need to set those up afterwards.
</tip>

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com
706.210.0168



More information about the thelist mailing list