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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 11th, 2005, 02:24 AM
Authorized User
 
Join Date: Aug 2005
Location: , , Finland.
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL Server append

How can I make a append command to one table?
Ex. If data in one table is 7 days old it would append all 7 days old data into another table.

Reply With Quote
  #2 (permalink)  
Old October 11th, 2005, 08:06 AM
Authorized User
 
Join Date: Sep 2005
Location: , , .
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Default

insert into newtable
select all from oldtable
where Fieldate <= dateadd(d,-7,getdate())

Fieldate is the field that holds your dates


http://sqlservercode.blogspot.com/
Reply With Quote
  #3 (permalink)  
Old October 12th, 2005, 12:40 AM
Authorized User
 
Join Date: Aug 2005
Location: , , Finland.
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How can I do this so it would run on server constantly, and not then when someone loads the page.

Reply With Quote
  #4 (permalink)  
Old October 12th, 2005, 08:49 PM
Friend of Wrox
 
Join Date: Aug 2004
Location: Orange County, CA, USA.
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

if you did it constantly it would duplicate the data constantly, it needs to be done when someone loads a page.

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
Conflict in SQL Server 2000 and SQL Server 2005 ayan.mukherjee SQL Language 0 June 30th, 2008 03:34 AM
SQL Server Reg. SQL Server does not exist error Arsi SQL Server 2000 1 June 11th, 2008 11:20 AM
migrating from sql server 2000 to sql server 2005 abinashpatra SQL Server 2005 2 December 1st, 2006 03:45 PM
Append quey - Accesss to SQL p2ptolu Classic ASP Databases 4 June 20th, 2005 06:29 AM
append to a query - from access to SQL server p2ptolu SQL Server 2000 0 June 15th, 2005 08:23 AM



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


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