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
 General SQL Server Forums
 New to SQL Server Programming
 procedure help

Author  Topic 

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2006-11-17 : 06:02:21
I've a database.i need to delete records of last 3 days.i dont know how to put that in job schedule.
please write the procedure or query for me

Vinod

coolerbob
Aged Yak Warrior

841 Posts

Posted - 2006-11-17 : 07:05:18
Hmm. Homework by any chance?
I should tell you that this is the answer:
truncate table MyTable

but that would not be very nice...
delete from Mytable where MyColumn<dateadd(day,-3,getdate())

Use SQL Server Agent to manage the schedule. It's quite simple. No explanation needed.



Me: What do you want to know from your data warehouse?
Client: Err...Emm...Everything
Me: OK, that's great. That's all I need to know. I'll see you when it's done.
Go to Top of Page
   

- Advertisement -