Solved

How to automatically delete data from database

Posted on 2009-06-29
4
426 Views
Last Modified: 2013-12-26
I need a function that checks and clean my database of old data, e g if its older than 4 months delete it.

I have Sql Management Server Studio Express so I can't do it with jobs.

Is windows service or webservice the way to go? or maybe windows schedule tasks

I need help to get started, so please give me some examples.

My next task is to be able in my aspx page to set dates for automatic email reminders for people that have not yet registered for different events.
0
Comment
Question by:mattegol
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 3

Accepted Solution

by:
sandip-mishra earned 250 total points
ID: 24734664
hi.. i am doing the same thing ......

I have created a console application and sheduled it. After every 24 hours it runs through the datatable and deletes the records that is 6 months old.

Hence you can use a windows application and schedule it.

Regards

Sandip Mishra

(web site signature removed by Moderator)
0
 

Author Comment

by:mattegol
ID: 24734692
Great!

This is exactly what I need..

Can you please give me an example of this or give me a how to link or guide me or something, I have never done this before and I'm in a hurry.

Regards
Mats
0
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 250 total points
ID: 24930132
if you are still interested...
you don't need to create/compile a application.

you can use sqlcmd.exe (which comes with sql server 2005+), which has a parameter to execute a sql statement. putting that into a plain .bat file (with notepad editor), and schedule that .bat in your windows scheduler, and you are done.
0

Featured Post

Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question