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
 Transact-SQL (2000)
 SProcedure Automiztion & Yesterday's date

Author  Topic 

jabedin
Starting Member

28 Posts

Posted - 2004-04-12 : 23:27:06
Hi there,

I need to run a stored procedure to collect data from a table and insert into another. I will use system date which will collect data comparing activity_date of the table.

- I want only yesterday's data as today may be incomplete. How do I get yesterday's date.
- I need to run it overnight through a scheduler. How can I make the automization.

Your help will be highly appreciated. Any sample stored Procedure would by greatly appreciated.

Regards




Jay
Bella Vista
NSW-2153

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2004-04-13 : 00:39:53
Yesterday's date is DateAdd(d, -1, GetDate())
To schedule it, open Enterprise Manager, find Management -> SQL Server Agent -> Jobs and right click to add a new job. The dialogs are pretty self explainatory, and Books Online has lots of info.



Damian
Go to Top of Page

jabedin
Starting Member

28 Posts

Posted - 2004-04-13 : 03:19:23
Thank you very much Damian.

Regards

Jay
Bella Vista
NSW-2153
Go to Top of Page
   

- Advertisement -