[thelist] [tip] duplicate a table structure

Paul Cowan evolt at funkwit.com
Sun Oct 12 22:18:08 CDT 2003


Joshua wrote:
> 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

or just...

SELECT TOP 0 *
INTO newtable
FROM oldtable

and save yourself a step!


Paul


More information about the thelist mailing list