p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   SQL Server 2000 (http://p2p.wrox.com/forumdisplay.php?f=20)
-   -   Copy whole structure of table in #temp table (http://p2p.wrox.com/showthread.php?t=51812)

maulik77 December 21st, 2006 02:23 AM

Copy whole structure of table in #temp table
 
Please let me know how can I Copy whole structure of table in #temp table with one single query.

Maulik Pandya

maulik77 December 21st, 2006 02:26 AM

Use following statement if desire only structure

SELECT * INTO #temp from tbl_BannerManager where 1<>1

and following for coplete structure with al the data

SELECT * INTO #temp from tbl_BannerManager

Maulik Pandya

maulik77 December 21st, 2006 02:42 AM

you can also use following for Selected records.

SELECT * INTO #temp from (Select top 3 * FROM tbl_BannerManager
        WHERE GETDATE() between dStartDate and dEndDate
        AND ndepth = 3)a

Cheers!!:)

Maulik Pandya


All times are GMT -4. The time now is 10:00 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.