Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 21st, 2006, 02:23 AM
Registered User
 
Join Date: Nov 2004
Location: Ahmedabad, Gujrat, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to maulik77 Send a message via Yahoo to maulik77
Default 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
Reply With Quote
  #2 (permalink)  
Old December 21st, 2006, 02:26 AM
Registered User
 
Join Date: Nov 2004
Location: Ahmedabad, Gujrat, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to maulik77 Send a message via Yahoo to maulik77
Default

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
Reply With Quote
  #3 (permalink)  
Old December 21st, 2006, 02:42 AM
Registered User
 
Join Date: Nov 2004
Location: Ahmedabad, Gujrat, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to maulik77 Send a message via Yahoo to maulik77
Default

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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TEMP TABLE TO REAL TABLE pallone SQL Server 2000 2 June 15th, 2007 07:50 AM
Copy table structure sagarbhargava SQL Server 2000 3 November 16th, 2006 03:16 AM
copy one table at server1 to another table Jane SQL Server 2000 2 January 31st, 2005 11:11 AM
global temp table vs.permanent table use sofya SQL Server 2000 0 December 17th, 2004 01:57 PM
copy and append records from table-A to table B bhunter Access 6 March 9th, 2004 02:02 PM



All times are GMT -4. The time now is 09:59 PM.


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