• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

Delete records every 30 mins ...

Hi Experts,

Is there a way to schedule a task to delete some records every 15-30 minutes in sqlserver.

1 Solution
If you are using sql server 2005 and above and it seems to be the case with you, then you can shedule your script or stored proc to delete every 15 minutes.

Just follow this link:


Anthony PerkinsCommented:
>>Is there a way to schedule a task to delete some records every 15-30 minutes in sqlserver.<<
It depends.  If you are using SQL Server Express than you will have to use Windows Scheduled Tasks, other wise you can use SQL Server Agent.

Kishan ZunjareSr. Software EngineerCommented:
You just need to schedule (e.g. using SQL Agent) some SQL to delete "stale" records, and schedule that to run as often as you need (every minute if you need it to delete promptly after 30 minutes.

FROM MyTable AS ColName
WHERE MyCreateDateColumn <= DATEADD(Minute, -30, GetDate())

Hope this will work.
Alpesh PatelAssistant ConsultantCommented:
Yes, Create a SQL Query and schedule it as SQL Job. It will execute in specified interval and purge data as per your condition in delete query.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now