Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Schedule DTS Package/Stored Procedure

Author  Topic 

sr_aneesh
Starting Member

17 Posts

Posted - 2004-11-19 : 10:59:33
I have a table called Students which gets updated daily

ID Name Class Age Admission_Date
1 Ams 9 14 11/15/04
2 Tom 12 19 11/17/04
3 Job 6 15 11/10/04
4 Mark 5 14 11/09/04
5 Steve 1 6 11/08/04

and another table called archive with the follwing fields

Name Class Age Date



I want to move all records from the Students table to archive two days after the admission_date automatically in the late evening.... on daily basis....

what DTS package or Stored Procedure do i need to write to do this also how do i schedule this so that the package runs automatically.... could some one explain this in detail...


Also I would highly appreciate if some one could recommaned me some good site to learn Stored Procedures/DTS Package / Scheduling..


Thanx in Advance


nr
SQLTeam MVY

12543 Posts

Posted - 2004-11-19 : 11:15:34
You would use a strored procedure not a dts package.

The SP will insert reacords into the archive table then delete those recs from the source table.
To schedule the SP look at management in enterprise manager. (sql server agent, jobs) you can create a job with a step to call the SP and schedule it.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

sr_aneesh
Starting Member

17 Posts

Posted - 2004-11-20 : 00:49:05
Thanx nr.....
any good site to learn about SP???
Go to Top of Page
   

- Advertisement -