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.
| Author |
Topic |
|
robbierut
Starting Member
1 Post |
Posted - 2011-11-11 : 13:28:43
|
| Hey,I need to compare the date of when a record is added(is in the record itself) with the date of today and when it expires (after 28 days) it needs to delete the whole record.Is this best done with a sql query or with a macro, and how should it start?Thanks in advanced!!! |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2011-11-11 : 14:23:34
|
| 1. create a sproc that compares each rows date with today's date and then deletes if it is stale 2. Plug the sproc into a SQL job that runs daily or whatever frequency you want it to run?If you don't have the passion to help people, you have no passion |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-12 : 05:44:01
|
quote: Originally posted by robbierut Hey,I need to compare the date of when a record is added(is in the record itself) with the date of today and when it expires (after 28 days) it needs to delete the whole record.Is this best done with a sql query or with a macro, and how should it start?Thanks in advanced!!!
we've few tidying up jobs like this and it makes use of sql procedures to do this and we've automated them using sql server agent for automated execution as yosiaz suggested------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|